move mod_wsgi to passenger_wsgi

This commit is contained in:
baoliang 2020-08-24 22:35:47 +08:00
commit 8656fc52a1
58 changed files with 6941 additions and 6746 deletions

View File

@ -1,153 +1,153 @@
"""
Django settings for NewMediaMonitoring project.
Generated by 'django-admin startproject' using Django 2.1.8.
For more information on this file, see
https://docs.djangoproject.com/en/2.1/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/2.1/ref/settings/
"""
import os
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
import sys
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
# Quick-start development settings - unsuitable for production
# See https://docs.djangoproject.com/en/2.1/howto/deployment/checklist/
# SECURITY WARNING: keep the secret key used in production secret!
SECRET_KEY = 'tj5m7-ns_6x_fvn2^q+7+2fopq!#7taqv!9ai(c_45i5!%m=*z'
# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = True
ALLOWED_HOSTS = ['*']
# Application definition
INSTALLED_APPS = [
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'django_token',
'corsheaders',
'bootstrap3',
'captcha',
'dashboard',
'management'
]
MIDDLEWARE = [
'django.middleware.security.SecurityMiddleware',
'django.middleware.locale.LocaleMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'corsheaders.middleware.CorsMiddleware',
'django.middleware.common.CommonMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
'django.middleware.clickjacking.XFrameOptionsMiddleware',
'django_token.middleware.TokenMiddleware',
]
ROOT_URLCONF = 'NewMediaMonitoring.urls'
TEMPLATES = [
{
'BACKEND': 'django.template.backends.django.DjangoTemplates',
'DIRS': [os.path.join(BASE_DIR, 'templates')],
'APP_DIRS': True,
'OPTIONS': {
'context_processors': [
'django.template.context_processors.debug',
'django.template.context_processors.request',
'django.contrib.auth.context_processors.auth',
'django.contrib.messages.context_processors.messages',
],
},
},
]
WSGI_APPLICATION = 'NewMediaMonitoring.wsgi.application'
# Database
# https://docs.djangoproject.com/en/2.1/ref/settings/#databases
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql_psycopg2',
'NAME': 'newmediaDB1',
'USER': 'newmedia',
'PASSWORD': 'newmedia2020!@#',
'HOST': '210.77.68.250',
'PORT': '5432',
}
}
# Password validation
# https://docs.djangoproject.com/en/2.1/ref/settings/#auth-password-validators
AUTH_PASSWORD_VALIDATORS = [
{
'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator',
},
{
'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator',
},
{
'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator',
},
{
'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator',
},
]
AUTHENTICATION_BACKENDS = (
'django.contrib.auth.backends.ModelBackend',
'django_token.backends.TokenBackend'
)
# Internationalization
# https://docs.djangoproject.com/en/2.1/topics/i18n/
LANGUAGE_CODE = 'zh-Hans'
TIME_ZONE = 'Asia/Shanghai'
USE_I18N = True
USE_L10N = True
USE_TZ = False
# Static files (CSS, JavaScript, Images)
# https://docs.djangoproject.com/en/2.1/howto/static-files/
STATIC_URL = '/static/'
STATICFILES_DIRS = [
os.path.join(BASE_DIR, "static"),
]
STATIC_ROOT = '/var/www/p3/newmediamonitoring/static/'
MEDIA_URL = '/media/'
MEDIA_ROOT = '/var/www/p3/newmediamonitoring/media/'
"""用户模块扩展部分"""
AUTH_PROFILE_MODULE = 'djangoadmin.myadmin.UserProfile'
"""用户模块扩展完成"""
CORS_ORIGIN_ALLOW_ALL = True
CORS_URLS_REGEX = r'^/polls/.*$'
try:
from .local_settings import *
except ImportError as e:
pass
"""
Django settings for NewMediaMonitoring project.
Generated by 'django-admin startproject' using Django 2.1.8.
For more information on this file, see
https://docs.djangoproject.com/en/2.1/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/2.1/ref/settings/
"""
import os
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
import sys
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
# Quick-start development settings - unsuitable for production
# See https://docs.djangoproject.com/en/2.1/howto/deployment/checklist/
# SECURITY WARNING: keep the secret key used in production secret!
SECRET_KEY = 'tj5m7-ns_6x_fvn2^q+7+2fopq!#7taqv!9ai(c_45i5!%m=*z'
# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = True
ALLOWED_HOSTS = ['*']
# Application definition
INSTALLED_APPS = [
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'django_token',
'corsheaders',
'bootstrap3',
'captcha',
'dashboard',
'management'
]
MIDDLEWARE = [
'django.middleware.security.SecurityMiddleware',
'django.middleware.locale.LocaleMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'corsheaders.middleware.CorsMiddleware',
'django.middleware.common.CommonMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
'django.middleware.clickjacking.XFrameOptionsMiddleware',
'django_token.middleware.TokenMiddleware',
]
ROOT_URLCONF = 'NewMediaMonitoring.urls'
TEMPLATES = [
{
'BACKEND': 'django.template.backends.django.DjangoTemplates',
'DIRS': [os.path.join(BASE_DIR, 'templates')],
'APP_DIRS': True,
'OPTIONS': {
'context_processors': [
'django.template.context_processors.debug',
'django.template.context_processors.request',
'django.contrib.auth.context_processors.auth',
'django.contrib.messages.context_processors.messages',
],
},
},
]
WSGI_APPLICATION = 'NewMediaMonitoring.wsgi.application'
# Database
# https://docs.djangoproject.com/en/2.1/ref/settings/#databases
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql_psycopg2',
'NAME': 'newmediaDB1',
'USER': 'newmedia',
'PASSWORD': 'newmedia2020!@#',
'HOST': '210.77.68.250',
'PORT': '5432',
}
}
# Password validation
# https://docs.djangoproject.com/en/2.1/ref/settings/#auth-password-validators
AUTH_PASSWORD_VALIDATORS = [
{
'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator',
},
{
'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator',
},
{
'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator',
},
{
'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator',
},
]
AUTHENTICATION_BACKENDS = (
'django.contrib.auth.backends.ModelBackend',
'django_token.backends.TokenBackend'
)
# Internationalization
# https://docs.djangoproject.com/en/2.1/topics/i18n/
LANGUAGE_CODE = 'zh-Hans'
TIME_ZONE = 'Asia/Shanghai'
USE_I18N = True
USE_L10N = True
USE_TZ = False
# Static files (CSS, JavaScript, Images)
# https://docs.djangoproject.com/en/2.1/howto/static-files/
STATIC_URL = '/static/'
STATICFILES_DIRS = [
os.path.join(BASE_DIR, "static"),
]
STATIC_ROOT = '/var/www/p3/newmediamonitoring/static/'
MEDIA_URL = '/media/'
MEDIA_ROOT = '/var/www/p3/newmediamonitoring/media/'
"""用户模块扩展部分"""
AUTH_PROFILE_MODULE = 'djangoadmin.myadmin.UserProfile'
"""用户模块扩展完成"""
CORS_ORIGIN_ALLOW_ALL = True
CORS_URLS_REGEX = r'^/polls/.*$'
try:
from .local_settings import *
except ImportError as e:
pass

View File

@ -18,11 +18,3 @@ from django.core.wsgi import get_wsgi_application
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'NewMediaMonitoring.settings')
sys.path.append("/var/www/p3/newmediamonitoring/current")
application = get_wsgi_application()
try:
application = get_wsgi_application()
except Exception:
# Error loading applications
if 'mod_wsgi' in sys.modules:
traceback.print_exc()
os.kill(os.getpid(), signal.SIGINT)
time.sleep(2.5)

View File

@ -17,4 +17,10 @@ git pull # enter username && password
source .venv/bin/activate
python manage.py make migrations
python manage.py migrate
```
# 查看服务器apache 内存使用情况
```shell
sudo /usr/sbin/passenger-memory-stats
```

View File

@ -1,357 +1,359 @@
import uuid
from django.contrib.auth.models import User
from django.db import models
# Create your models here.
class Group_type(models.Model):
id = models.UUIDField('id', primary_key=True, default=uuid.uuid4)
type = models.CharField('群组类型',max_length=256,null=True,blank=True)
def __str__(self):
return self.type
# 群组
class Group(models.Model):
GROUP_STATUS_CHOICES = (
('0','关闭'),
('1','开启')
)
id = models.UUIDField('id', primary_key=True, default=uuid.uuid4)
name = models.CharField('群组名称', max_length=256, null=True, blank=True)
presentation = models.TextField('群组描述', null=True, blank=True)
image = models.FileField(upload_to='groupimage', null=True, blank=True)
type = models.ForeignKey(Group_type,on_delete=models.CASCADE,null=True,blank=True)
status = models.CharField('状态',max_length=256,null=True,blank=True,choices=GROUP_STATUS_CHOICES)
province = models.CharField('', max_length=256, null=True, blank=True)
cities = models.CharField('', max_length=256, null=True, blank=True)
district = models.CharField('', max_length=256, null=True, blank=True)
town = models.CharField('', max_length=256, null=True, blank=True)
village = models.CharField('', max_length=256, null=True, blank=True)
created = models.DateTimeField('创建时间', auto_now_add=True)
updated = models.DateTimeField('更新时间', auto_now=True)
def __str__(self):
return self.name
#群组管理员
class Group_admin(models.Model):
id = models.UUIDField('id', primary_key=True, default=uuid.uuid4)
user = models.ForeignKey(User, on_delete=models.CASCADE, null=True, blank=True)
group = models.ForeignKey(Group, on_delete=models.CASCADE, null=True, blank=True)
created = models.DateTimeField('创建时间', auto_now_add=True)
updated = models.DateTimeField('更新时间', auto_now=True)
def __str__(self):
return self.group.name
#群组成员
class Group_user(models.Model):
id = models.UUIDField('id', primary_key=True, default=uuid.uuid4)
user = models.ForeignKey(User, on_delete=models.CASCADE, null=True, blank=True)
group = models.ForeignKey(Group, on_delete=models.CASCADE, null=True, blank=True)
created = models.DateTimeField('创建时间', auto_now_add=True)
updated = models.DateTimeField('更新时间', auto_now=True)
def __str__(self):
return self.user.username
# 权限等级
class Level(models.Model):
id = models.UUIDField('id', primary_key=True, default=uuid.uuid4)
name = models.CharField('等级名', max_length=256, null=True, blank=True)
level = models.IntegerField('级别', blank=True, null=True,default=0)
created = models.DateTimeField('创建时间', auto_now_add=True)
updated = models.DateTimeField('更新时间', auto_now=True)
def __str__(self):
return self.name
#单位类型
class Organizationtype(models.Model):
id = models.UUIDField('id',primary_key=True,default=uuid.uuid4)
organizationtype = models.CharField('单位类型',blank=True,null=True,max_length=256)
created = models.DateTimeField('创建时间', auto_now_add=True)
updated = models.DateTimeField('更新时间', auto_now=True)
def __str__(self):
return self.organizationtype
# 单位
class Organization(models.Model):
id = models.UUIDField('id', primary_key=True, default=uuid.uuid4)
name = models.CharField('单位名', max_length=256, null=True, blank=True)
image = models.FileField(upload_to='cover', null=True, blank=True)
organizationtype = models.ForeignKey(Organizationtype,on_delete=models.CASCADE, null=True, blank=True)
province = models.CharField('',max_length=256,null=True,blank=True)
cities = models.CharField('',max_length=256,null=True,blank=True)
district = models.CharField('',max_length=256,null=True,blank=True)
town = models.CharField('',max_length=256,null=True,blank=True)
village = models.CharField('',max_length=256,null=True,blank=True)
# group = models.ForeignKey(Group, on_delete=models.CASCADE, null=True, blank=True)
# level = models.ForeignKey(Level,on_delete=models.CASCADE,null=True,blank=True)
created = models.DateTimeField('创建时间', auto_now_add=True)
updated = models.DateTimeField('更新时间', auto_now=True)
def __str__(self):
return self.name
# 扩展用户表
class Userprofile(models.Model):
user = models.ForeignKey(User, on_delete=models.CASCADE)
name = models.CharField('姓名', null=True, blank=True, max_length=256)
sex = models.CharField('性别', null=True, blank=True, max_length=256)
image = models.FileField(upload_to='profile', null=True, blank=True)
organization = models.ForeignKey(Organization, on_delete=models.CASCADE, null=True, blank=True)
def __str__(self):
return self.user.username
def create_user_profile(sender, instance, created, **kwargs):
"""Create the UserProfile when a new User is saved"""
if created:
profile = Userprofile()
profile.user = instance
profile.save()
# 微信公众号
class Weixin(models.Model):
WEIXIN_STATUS_CHOICES = (
('1', '开启'),
('0', '关闭')
)
id = models.UUIDField('id', primary_key=True, default=uuid.uuid4)
code = models.CharField('微信公众号', max_length=256, null=True, blank=True)
weixinid = models.CharField('微信ID',max_length=256,null=True,blank=True)
alias = models.CharField('别名',max_length=256,null=True,blank=True)
image = models.FileField(upload_to='cover', null=True, blank=True)
organization = models.ForeignKey(Organization, on_delete=models.CASCADE, null=True, blank=True)
status = models.CharField('状态',max_length=256,null=True,blank=True,choices=WEIXIN_STATUS_CHOICES)
created = models.DateTimeField('创建时间', auto_now_add=True)
updated = models.DateTimeField('更新时间', auto_now=True)
def __str__(self):
return self.code
# 微信文章采集
class Weixin_data(models.Model):
id = models.UUIDField('id', primary_key=True, default=uuid.uuid4)
title = models.CharField('文章标题', max_length=256, null=True, blank=True)
site = models.CharField('位置', max_length=256, null=True, blank=True)
date = models.CharField('发文时间', max_length=256, null=True, blank=True)
original = models.BooleanField('是否原创', null=True, blank=True)
url = models.CharField('文章链接', max_length=256, null=True, blank=True)
author = models.CharField('作者', max_length=256, null=True, blank=True)
comment = models.CharField('评论数', max_length=256, null=True, blank=True)
reply = models.CharField('作者回复数', max_length=256, null=True, blank=True)
content = models.TextField('正文', null=True, blank=True)
weixin = models.ForeignKey(Weixin, on_delete=models.CASCADE, null=True, blank=True)
created = models.DateTimeField('创建时间', auto_now_add=True)
updated = models.DateTimeField('更新时间', auto_now=True)
def __str__(self):
return self.title
# 微信评论
class Weixin_comment(models.Model):
id = models.UUIDField('id', primary_key=True, default=uuid.uuid4)
comment = models.TextField('评论', null=True, blank=True)
user = models.CharField('用户', max_length=256, null=True, blank=True)
reply = models.TextField('回复', null=True, blank=True)
weixin = models.ForeignKey(Weixin, on_delete=models.CASCADE, null=True, blank=True)
created = models.DateTimeField('创建时间', auto_now_add=True)
updated = models.DateTimeField('更新时间', auto_now=True)
def __str__(self):
return self.user
# 微信错别字
class Weixin_Wrong(models.Model):
id = models.UUIDField('id', primary_key=True, default=uuid.uuid4)
wrong = models.CharField('错别字', max_length=256, null=True, blank=True)
idea = models.CharField('建议', max_length=256, null=True, blank=True)
site = models.CharField('位置', max_length=256, null=True, blank=True)
weixin = models.ForeignKey(Weixin, on_delete=models.CASCADE, null=True, blank=True)
change = models.BooleanField('是否已修改', null=True, blank=True)
created = models.DateTimeField('创建时间', auto_now_add=True)
updated = models.DateTimeField('更新时间', auto_now=True)
def __str__(self):
return self.wrong
# 微博
class Weibo(models.Model):
WEIBO_STATUS_CHOICES = (
('1', '开启'),
('0', '关闭')
)
id = models.UUIDField('id', primary_key=True, default=uuid.uuid4)
code = models.CharField('微博号', max_length=256, null=True, blank=True)
weiboid = models.CharField('微博ID', max_length=256, null=True, blank=True)
alias = models.CharField('别名', max_length=256, null=True, blank=True)
image = models.FileField(upload_to='cover', null=True, blank=True)
organization = models.ForeignKey(Organization, on_delete=models.CASCADE, null=True, blank=True)
status = models.CharField('状态', max_length=256, null=True, blank=True, choices=WEIBO_STATUS_CHOICES)
created = models.DateTimeField('创建时间', auto_now_add=True)
updated = models.DateTimeField('更新时间', auto_now=True)
def __str__(self):
return self.code
# 微博文章采集
class Weibi_data(models.Model):
id = models.UUIDField('id', primary_key=True, default=uuid.uuid4)
weiboid = models.CharField('微博ID', max_length=256, null=True, blank=True)
content = models.TextField('正文', null=True, blank=True)
url = models.CharField('文章url', max_length=256, null=True, blank=True)
originalimageurl = models.CharField('原始图片url', max_length=256, null=True, blank=True)
transpondimageurl = models.CharField('转发图片url', max_length=256, null=True, blank=True)
original = models.BooleanField('是否原创', null=True, blank=True)
site = models.CharField('发布位置', max_length=256, null=True, blank=True)
date = models.CharField('发布时间', max_length=256, null=True, blank=True)
tool = models.CharField('发布工具', max_length=256, null=True, blank=True)
like = models.CharField('点赞数', max_length=256, null=True, blank=True)
transpond = models.CharField('转发数', max_length=256, null=True, blank=True)
comment = models.CharField('评论数', max_length=256, null=True, blank=True)
title = models.CharField('文章标题', max_length=256, null=True, blank=True)
weibo = models.ForeignKey(Weibo, on_delete=models.CASCADE, null=True, blank=True)
created = models.DateTimeField('创建时间', auto_now_add=True)
updated = models.DateTimeField('更新时间', auto_now=True)
def __str__(self):
return self.title
# 微博错别字
class Weibo_Wrong(models.Model):
id = models.UUIDField('id', primary_key=True, default=uuid.uuid4)
wrong = models.CharField('错别字', max_length=256, null=True, blank=True)
idea = models.CharField('建议', max_length=256, null=True, blank=True)
site = models.CharField('位置', max_length=256, null=True, blank=True)
weibo = models.ForeignKey(Weibo, on_delete=models.CASCADE, null=True, blank=True)
change = models.BooleanField('是否已修改', null=True, blank=True)
created = models.DateTimeField('创建时间', auto_now_add=True)
updated = models.DateTimeField('更新时间', auto_now=True)
# 今日头条
class Toutiao(models.Model):
TOUTIAO_STATUS_CHOICES = (
('1', '开启'),
('0', '关闭')
)
id = models.UUIDField('id', primary_key=True, default=uuid.uuid4)
code = models.CharField('头条号', max_length=256, null=True, blank=True)
toutiaoid = models.CharField('头条ID', max_length=256, null=True, blank=True)
alias = models.CharField('别名', max_length=256, null=True, blank=True)
image = models.FileField(upload_to='cover', null=True, blank=True)
organization = models.ForeignKey(Organization, on_delete=models.CASCADE, null=True, blank=True)
status = models.CharField('状态', max_length=256, null=True, blank=True, choices=TOUTIAO_STATUS_CHOICES)
created = models.DateTimeField('创建时间', auto_now_add=True)
updated = models.DateTimeField('更新时间', auto_now=True)
def __str__(self):
return self.code
# 今日头条数据
class Toutiao_data(models.Model):
id = models.UUIDField('id', primary_key=True, default=uuid.uuid4)
title = models.CharField('标题', max_length=256, null=True, blank=True)
url = models.CharField('链接', max_length=256, null=True, blank=True)
img = models.CharField('缩略图', max_length=256, null=True, blank=True)
count = models.CharField('阅读数', max_length=256, null=True, blank=True)
commentcount = models.CharField('评论数', max_length=256, null=True, blank=True)
reply = models.CharField('作者回复数', max_length=256, null=True, blank=True)
date = models.CharField('时间', max_length=256, null=True, blank=True)
content = models.TextField('正文', null=True, blank=True)
comment = models.TextField('评论', null=True, blank=True)
toutiao = models.ForeignKey(Toutiao, on_delete=models.CASCADE, null=True, blank=True)
created = models.DateTimeField('创建时间', auto_now_add=True)
updated = models.DateTimeField('更新时间', auto_now=True)
def __str__(self):
return self.title
# 今日头条评论
class Toutiao_comment(models.Model):
id = models.UUIDField('id', primary_key=True, default=uuid.uuid4)
comment = models.TextField('评论', null=True, blank=True)
user = models.CharField('用户', max_length=256, null=True, blank=True)
reply = models.TextField('回复', null=True, blank=True)
toutiao = models.ForeignKey(Toutiao, on_delete=models.CASCADE, null=True, blank=True)
created = models.DateTimeField('创建时间', auto_now_add=True)
updated = models.DateTimeField('更新时间', auto_now=True)
def __str__(self):
return self.user
# 今日头条错别字
class Toutiao_Wrong(models.Model):
id = models.UUIDField('id', primary_key=True, default=uuid.uuid4)
wrong = models.CharField('错别字', max_length=256, null=True, blank=True)
idea = models.CharField('建议', max_length=256, null=True, blank=True)
site = models.CharField('位置', max_length=256, null=True, blank=True)
toutiao = models.ForeignKey(Toutiao, on_delete=models.CASCADE, null=True, blank=True)
change = models.BooleanField('是否已修改', null=True, blank=True)
created = models.DateTimeField('创建时间', auto_now_add=True)
updated = models.DateTimeField('更新时间', auto_now=True)
def __str__(self):
return self.wrong
# 其他新媒体
class Qita(models.Model):
QITA_STATUS_CHOICES = (
('1', '开启'),
('0', '关闭')
)
id = models.UUIDField('id', primary_key=True, default=uuid.uuid4)
type = models.CharField('新媒体类型', max_length=256, null=True, blank=True)
name = models.CharField('新媒体名称', max_length=256, null=True, blank=True)
qitaid = models.CharField('新媒体ID', max_length=256, null=True, blank=True)
alias = models.CharField('别名', max_length=256, null=True, blank=True)
image = models.FileField(upload_to='cover', null=True, blank=True)
organization = models.ForeignKey(Organization, on_delete=models.CASCADE, null=True, blank=True)
status = models.CharField('状态', max_length=256, null=True, blank=True, choices=QITA_STATUS_CHOICES)
created = models.DateTimeField('创建时间', auto_now_add=True)
updated = models.DateTimeField('更新时间', auto_now=True)
def __str__(self):
return self.name
#其他新媒体监测
class Qita_jc(models.Model):
id = models.UUIDField('id', primary_key=True, default=uuid.uuid4)
mewnedia = models.ForeignKey(Qita,on_delete=models.CASCADE)
count = models.CharField('总发文量', max_length=256, null=True, blank=True)
count_jc = models.CharField('监测时间内发文量', max_length=256, null=True, blank=True)
comment = models.CharField('评论数', max_length=256, null=True, blank=True)
reply = models.CharField('作者回复数', max_length=256, null=True, blank=True)
date = models.CharField('最近发文日期', max_length=256, null=True, blank=True)
created = models.DateTimeField('创建时间', auto_now_add=True)
updated = models.DateTimeField('更新时间', auto_now=True)
def __str__(self):
return self.mewnedia.name
#5级地名库
class Area_code_2020(models.Model):
code = models.CharField('区划代码',max_length=256,null=True,blank=True)
name = models.CharField('名称',max_length=256,null=True,blank=True)
level = models.CharField('级别1-5,省市县镇村',max_length=256,null=True,blank=True)
pcode = models.CharField('父级区划代码',max_length=256,null=True,blank=True)
def __str__(self):
return self.name
import uuid
from django.contrib.auth.models import User
from django.db import models
# 权限等级
class Level(models.Model):
id = models.UUIDField('id', primary_key=True, default=uuid.uuid4)
name = models.CharField('等级名', max_length=256, null=True, blank=True)
level = models.IntegerField('级别', blank=True, null=True,default=0)
created = models.DateTimeField('创建时间', auto_now_add=True)
updated = models.DateTimeField('更新时间', auto_now=True)
def __str__(self):
return self.name
# Create your models here.
class Group_type(models.Model):
id = models.UUIDField('id', primary_key=True, default=uuid.uuid4)
type = models.CharField('群组类型',max_length=256,null=True,blank=True)
def __str__(self):
return self.type
# 群组
class Group(models.Model):
GROUP_STATUS_CHOICES = (
('0','关闭'),
('1','开启')
)
id = models.UUIDField('id', primary_key=True, default=uuid.uuid4)
name = models.CharField('群组名称', max_length=256, null=True, blank=True)
presentation = models.TextField('群组描述', null=True, blank=True)
image = models.FileField(upload_to='groupimage', null=True, blank=True)
type = models.ForeignKey(Group_type,on_delete=models.CASCADE,null=True,blank=True)
status = models.CharField('状态',max_length=256,null=True,blank=True,choices=GROUP_STATUS_CHOICES)
province = models.CharField('', max_length=256, null=True, blank=True)
cities = models.CharField('', max_length=256, null=True, blank=True)
district = models.CharField('', max_length=256, null=True, blank=True)
town = models.CharField('', max_length=256, null=True, blank=True)
village = models.CharField('', max_length=256, null=True, blank=True)
created = models.DateTimeField('创建时间', auto_now_add=True)
updated = models.DateTimeField('更新时间', auto_now=True)
def __str__(self):
return self.name
#群组管理员
class Group_admin(models.Model):
id = models.UUIDField('id', primary_key=True, default=uuid.uuid4)
user = models.ForeignKey(User, on_delete=models.CASCADE, null=True, blank=True)
group = models.ForeignKey(Group, on_delete=models.CASCADE, null=True, blank=True)
created = models.DateTimeField('创建时间', auto_now_add=True)
updated = models.DateTimeField('更新时间', auto_now=True)
def __str__(self):
return self.group.name
#群组成员
class Group_user(models.Model):
id = models.UUIDField('id', primary_key=True, default=uuid.uuid4)
user = models.ForeignKey(User, on_delete=models.CASCADE, null=True, blank=True)
group = models.ForeignKey(Group, on_delete=models.CASCADE, null=True, blank=True)
created = models.DateTimeField('创建时间', auto_now_add=True)
updated = models.DateTimeField('更新时间', auto_now=True)
def __str__(self):
return self.user.username
#单位类型
class Organizationtype(models.Model):
id = models.UUIDField('id',primary_key=True,default=uuid.uuid4)
organizationtype = models.CharField('单位类型',blank=True,null=True,max_length=256)
created = models.DateTimeField('创建时间', auto_now_add=True)
updated = models.DateTimeField('更新时间', auto_now=True)
def __str__(self):
return self.organizationtype
# 单位
class Organization(models.Model):
id = models.UUIDField('id', primary_key=True, default=uuid.uuid4)
name = models.CharField('单位名', max_length=256, null=True, blank=True)
image = models.FileField(upload_to='cover', null=True, blank=True)
organizationtype = models.ForeignKey(Organizationtype,on_delete=models.CASCADE, null=True, blank=True)
province = models.CharField('',max_length=256,null=True,blank=True)
cities = models.CharField('',max_length=256,null=True,blank=True)
district = models.CharField('',max_length=256,null=True,blank=True)
town = models.CharField('',max_length=256,null=True,blank=True)
village = models.CharField('',max_length=256,null=True,blank=True)
# group = models.ForeignKey(Group, on_delete=models.CASCADE, null=True, blank=True)
# level = models.ForeignKey(Level,on_delete=models.CASCADE,null=True,blank=True)
created = models.DateTimeField('创建时间', auto_now_add=True)
updated = models.DateTimeField('更新时间', auto_now=True)
def __str__(self):
return self.name
# 扩展用户表
class Userprofile(models.Model):
user = models.ForeignKey(User, on_delete=models.CASCADE)
name = models.CharField('姓名', null=True, blank=True, max_length=256)
sex = models.CharField('性别', null=True, blank=True, max_length=256)
image = models.FileField(upload_to='profile', null=True, blank=True)
organization = models.ForeignKey(Organization, on_delete=models.CASCADE, null=True, blank=True)
#用户状态:注册进来默认为0为未审核状态审核后status=1
status = models.IntegerField('用户状态',null=True,blank=True,default=0)
def __str__(self):
return self.user.username
def create_user_profile(sender, instance, created, **kwargs):
"""Create the UserProfile when a new User is saved"""
if created:
profile = Userprofile()
profile.user = instance
profile.save()
# 微信公众号
class Weixin(models.Model):
WEIXIN_STATUS_CHOICES = (
('1', '开启'),
('0', '关闭')
)
id = models.UUIDField('id', primary_key=True, default=uuid.uuid4)
code = models.CharField('微信公众号', max_length=256, null=True, blank=True)
weixinid = models.CharField('微信ID',max_length=256,null=True,blank=True)
alias = models.CharField('别名',max_length=256,null=True,blank=True)
image = models.FileField(upload_to='cover', null=True, blank=True)
organization = models.ForeignKey(Organization, on_delete=models.CASCADE, null=True, blank=True)
status = models.CharField('状态',max_length=256,null=True,blank=True,choices=WEIXIN_STATUS_CHOICES)
created = models.DateTimeField('创建时间', auto_now_add=True)
updated = models.DateTimeField('更新时间', auto_now=True)
def __str__(self):
return self.code
# 微信文章采集
class Weixin_data(models.Model):
id = models.UUIDField('id', primary_key=True, default=uuid.uuid4)
title = models.CharField('文章标题', max_length=256, null=True, blank=True)
site = models.CharField('位置', max_length=256, null=True, blank=True)
date = models.CharField('发文时间', max_length=256, null=True, blank=True)
original = models.BooleanField('是否原创', null=True, blank=True)
url = models.CharField('文章链接', max_length=256, null=True, blank=True)
author = models.CharField('作者', max_length=256, null=True, blank=True)
comment = models.CharField('评论数', max_length=256, null=True, blank=True)
reply = models.CharField('作者回复数', max_length=256, null=True, blank=True)
content = models.TextField('正文', null=True, blank=True)
weixin = models.ForeignKey(Weixin, on_delete=models.CASCADE, null=True, blank=True)
created = models.DateTimeField('创建时间', auto_now_add=True)
updated = models.DateTimeField('更新时间', auto_now=True)
def __str__(self):
return self.title
# 微信评论
class Weixin_comment(models.Model):
id = models.UUIDField('id', primary_key=True, default=uuid.uuid4)
comment = models.TextField('评论', null=True, blank=True)
user = models.CharField('用户', max_length=256, null=True, blank=True)
reply = models.TextField('回复', null=True, blank=True)
weixin = models.ForeignKey(Weixin, on_delete=models.CASCADE, null=True, blank=True)
created = models.DateTimeField('创建时间', auto_now_add=True)
updated = models.DateTimeField('更新时间', auto_now=True)
def __str__(self):
return self.user
# 微信错别字
class Weixin_Wrong(models.Model):
id = models.UUIDField('id', primary_key=True, default=uuid.uuid4)
wrong = models.CharField('错别字', max_length=256, null=True, blank=True)
idea = models.CharField('建议', max_length=256, null=True, blank=True)
site = models.CharField('位置', max_length=256, null=True, blank=True)
weixin = models.ForeignKey(Weixin, on_delete=models.CASCADE, null=True, blank=True)
change = models.BooleanField('是否已修改', null=True, blank=True)
created = models.DateTimeField('创建时间', auto_now_add=True)
updated = models.DateTimeField('更新时间', auto_now=True)
def __str__(self):
return self.wrong
# 微博
class Weibo(models.Model):
WEIBO_STATUS_CHOICES = (
('1', '开启'),
('0', '关闭')
)
id = models.UUIDField('id', primary_key=True, default=uuid.uuid4)
code = models.CharField('微博号', max_length=256, null=True, blank=True)
weiboid = models.CharField('微博ID', max_length=256, null=True, blank=True)
alias = models.CharField('别名', max_length=256, null=True, blank=True)
image = models.FileField(upload_to='cover', null=True, blank=True)
organization = models.ForeignKey(Organization, on_delete=models.CASCADE, null=True, blank=True)
status = models.CharField('状态', max_length=256, null=True, blank=True, choices=WEIBO_STATUS_CHOICES)
created = models.DateTimeField('创建时间', auto_now_add=True)
updated = models.DateTimeField('更新时间', auto_now=True)
def __str__(self):
return self.code
# 微博文章采集
class Weibi_data(models.Model):
id = models.UUIDField('id', primary_key=True, default=uuid.uuid4)
weiboid = models.CharField('微博ID', max_length=256, null=True, blank=True)
content = models.TextField('正文', null=True, blank=True)
url = models.CharField('文章url', max_length=256, null=True, blank=True)
originalimageurl = models.CharField('原始图片url', max_length=256, null=True, blank=True)
transpondimageurl = models.CharField('转发图片url', max_length=256, null=True, blank=True)
original = models.BooleanField('是否原创', null=True, blank=True)
site = models.CharField('发布位置', max_length=256, null=True, blank=True)
date = models.CharField('发布时间', max_length=256, null=True, blank=True)
tool = models.CharField('发布工具', max_length=256, null=True, blank=True)
like = models.CharField('点赞数', max_length=256, null=True, blank=True)
transpond = models.CharField('转发数', max_length=256, null=True, blank=True)
comment = models.CharField('评论数', max_length=256, null=True, blank=True)
title = models.CharField('文章标题', max_length=256, null=True, blank=True)
weibo = models.ForeignKey(Weibo, on_delete=models.CASCADE, null=True, blank=True)
created = models.DateTimeField('创建时间', auto_now_add=True)
updated = models.DateTimeField('更新时间', auto_now=True)
def __str__(self):
return self.title
# 微博错别字
class Weibo_Wrong(models.Model):
id = models.UUIDField('id', primary_key=True, default=uuid.uuid4)
wrong = models.CharField('错别字', max_length=256, null=True, blank=True)
idea = models.CharField('建议', max_length=256, null=True, blank=True)
site = models.CharField('位置', max_length=256, null=True, blank=True)
weibo = models.ForeignKey(Weibo, on_delete=models.CASCADE, null=True, blank=True)
change = models.BooleanField('是否已修改', null=True, blank=True)
created = models.DateTimeField('创建时间', auto_now_add=True)
updated = models.DateTimeField('更新时间', auto_now=True)
# 今日头条
class Toutiao(models.Model):
TOUTIAO_STATUS_CHOICES = (
('1', '开启'),
('0', '关闭')
)
id = models.UUIDField('id', primary_key=True, default=uuid.uuid4)
code = models.CharField('头条号', max_length=256, null=True, blank=True)
toutiaoid = models.CharField('头条ID', max_length=256, null=True, blank=True)
alias = models.CharField('别名', max_length=256, null=True, blank=True)
image = models.FileField(upload_to='cover', null=True, blank=True)
organization = models.ForeignKey(Organization, on_delete=models.CASCADE, null=True, blank=True)
status = models.CharField('状态', max_length=256, null=True, blank=True, choices=TOUTIAO_STATUS_CHOICES)
created = models.DateTimeField('创建时间', auto_now_add=True)
updated = models.DateTimeField('更新时间', auto_now=True)
def __str__(self):
return self.code
# 今日头条数据
class Toutiao_data(models.Model):
id = models.UUIDField('id', primary_key=True, default=uuid.uuid4)
title = models.CharField('标题', max_length=256, null=True, blank=True)
url = models.CharField('链接', max_length=256, null=True, blank=True)
img = models.CharField('缩略图', max_length=256, null=True, blank=True)
count = models.CharField('阅读数', max_length=256, null=True, blank=True)
commentcount = models.CharField('评论数', max_length=256, null=True, blank=True)
reply = models.CharField('作者回复数', max_length=256, null=True, blank=True)
date = models.CharField('时间', max_length=256, null=True, blank=True)
content = models.TextField('正文', null=True, blank=True)
comment = models.TextField('评论', null=True, blank=True)
toutiao = models.ForeignKey(Toutiao, on_delete=models.CASCADE, null=True, blank=True)
created = models.DateTimeField('创建时间', auto_now_add=True)
updated = models.DateTimeField('更新时间', auto_now=True)
def __str__(self):
return self.title
# 今日头条评论
class Toutiao_comment(models.Model):
id = models.UUIDField('id', primary_key=True, default=uuid.uuid4)
comment = models.TextField('评论', null=True, blank=True)
user = models.CharField('用户', max_length=256, null=True, blank=True)
reply = models.TextField('回复', null=True, blank=True)
toutiao = models.ForeignKey(Toutiao, on_delete=models.CASCADE, null=True, blank=True)
created = models.DateTimeField('创建时间', auto_now_add=True)
updated = models.DateTimeField('更新时间', auto_now=True)
def __str__(self):
return self.user
# 今日头条错别字
class Toutiao_Wrong(models.Model):
id = models.UUIDField('id', primary_key=True, default=uuid.uuid4)
wrong = models.CharField('错别字', max_length=256, null=True, blank=True)
idea = models.CharField('建议', max_length=256, null=True, blank=True)
site = models.CharField('位置', max_length=256, null=True, blank=True)
toutiao = models.ForeignKey(Toutiao, on_delete=models.CASCADE, null=True, blank=True)
change = models.BooleanField('是否已修改', null=True, blank=True)
created = models.DateTimeField('创建时间', auto_now_add=True)
updated = models.DateTimeField('更新时间', auto_now=True)
def __str__(self):
return self.wrong
# 其他新媒体
class Qita(models.Model):
QITA_STATUS_CHOICES = (
('1', '开启'),
('0', '关闭')
)
id = models.UUIDField('id', primary_key=True, default=uuid.uuid4)
type = models.CharField('新媒体类型', max_length=256, null=True, blank=True)
name = models.CharField('新媒体名称', max_length=256, null=True, blank=True)
qitaid = models.CharField('新媒体ID', max_length=256, null=True, blank=True)
alias = models.CharField('别名', max_length=256, null=True, blank=True)
image = models.FileField(upload_to='cover', null=True, blank=True)
organization = models.ForeignKey(Organization, on_delete=models.CASCADE, null=True, blank=True)
status = models.CharField('状态', max_length=256, null=True, blank=True, choices=QITA_STATUS_CHOICES)
created = models.DateTimeField('创建时间', auto_now_add=True)
updated = models.DateTimeField('更新时间', auto_now=True)
def __str__(self):
return self.name
#其他新媒体监测
class Qita_jc(models.Model):
id = models.UUIDField('id', primary_key=True, default=uuid.uuid4)
mewnedia = models.ForeignKey(Qita,on_delete=models.CASCADE)
count = models.CharField('总发文量', max_length=256, null=True, blank=True)
count_jc = models.CharField('监测时间内发文量', max_length=256, null=True, blank=True)
comment = models.CharField('评论数', max_length=256, null=True, blank=True)
reply = models.CharField('作者回复数', max_length=256, null=True, blank=True)
date = models.CharField('最近发文日期', max_length=256, null=True, blank=True)
created = models.DateTimeField('创建时间', auto_now_add=True)
updated = models.DateTimeField('更新时间', auto_now=True)
def __str__(self):
return self.mewnedia.name
#5级地名库
class Area_code_2020(models.Model):
code = models.CharField('区划代码',max_length=256,null=True,blank=True)
name = models.CharField('名称',max_length=256,null=True,blank=True)
level = models.CharField('级别1-5,省市县镇村',max_length=256,null=True,blank=True)
pcode = models.CharField('父级区划代码',max_length=256,null=True,blank=True)
def __str__(self):
return self.name

View File

@ -1,381 +1,383 @@
{% load static %}
<div class='page-topbar '>
<div class='logo-area'>
</div>
<div class='quick-area'>
<div class='pull-left'>
<ul class="info-menu left-links list-inline list-unstyled">
<li class="sidebar-toggle-wrap">
<a href="#" data-toggle="sidebar" class="sidebar_toggle">
<i class="fa fa-bars"></i>
</a>
</li>
<li class="">
<a href="#" data-toggle="dropdown" class="toggle">
<i class="fa fa-envelope"></i>
<span class="badge badge-primary">7</span>
</a>
<ul class="dropdown-menu messages animated fadeIn">
<li class="list">
<ul class="dropdown-menu-list list-unstyled ps-scrollbar">
<li class="unread status-available">
<a href="javascript:;">
<div class="user-img">
<img src="{% static 'dashboard/image/avatar-1.png' %}" alt="user-image"
class="img-circle img-inline">
</div>
<div>
<span class="name">
<strong>Clarine Vassar</strong>
<span class="time small">- 15 mins ago</span>
<span class="profile-status available pull-right"></span>
</span>
<span class="desc small">
Sometimes it takes a lifetime to win a battle.
</span>
</div>
</a>
</li>
<li class=" status-away">
<a href="javascript:;">
<div class="user-img">
<img src="{% static 'dashboard/image/avatar-2.png' %}" alt="user-image"
class="img-circle img-inline">
</div>
<div>
<span class="name">
<strong>Brooks Latshaw</strong>
<span class="time small">- 45 mins ago</span>
<span class="profile-status away pull-right"></span>
</span>
<span class="desc small">
Sometimes it takes a lifetime to win a battle.
</span>
</div>
</a>
</li>
<li class=" status-busy">
<a href="javascript:;">
<div class="user-img">
<img src="{% static 'dashboard/image/avatar-3.png' %}" alt="user-image"
class="img-circle img-inline">
</div>
<div>
<span class="name">
<strong>Clementina Brodeur</strong>
<span class="time small">- 1 hour ago</span>
<span class="profile-status busy pull-right"></span>
</span>
<span class="desc small">
Sometimes it takes a lifetime to win a battle.
</span>
</div>
</a>
</li>
<li class=" status-offline">
<a href="javascript:;">
<div class="user-img">
<img src="{% static 'dashboard/image/avatar-4.png' %}" alt="user-image"
class="img-circle img-inline">
</div>
<div>
<span class="name">
<strong>Carri Busey</strong>
<span class="time small">- 5 hours ago</span>
<span class="profile-status offline pull-right"></span>
</span>
<span class="desc small">
Sometimes it takes a lifetime to win a battle.
</span>
</div>
</a>
</li>
<li class=" status-offline">
<a href="javascript:;">
<div class="user-img">
<img src="{% static 'dashboard/image/avatar-5.png' %}" alt="user-image"
class="img-circle img-inline">
</div>
<div>
<span class="name">
<strong>Melissa Dock</strong>
<span class="time small">- Yesterday</span>
<span class="profile-status offline pull-right"></span>
</span>
<span class="desc small">
Sometimes it takes a lifetime to win a battle.
</span>
</div>
</a>
</li>
<li class=" status-available">
<a href="javascript:;">
<div class="user-img">
<img src="{% static 'dashboard/image/avatar-1.png' %}" alt="user-image"
class="img-circle img-inline">
</div>
<div>
<span class="name">
<strong>Verdell Rea</strong>
<span class="time small">- 14th Mar</span>
<span class="profile-status available pull-right"></span>
</span>
<span class="desc small">
Sometimes it takes a lifetime to win a battle.
</span>
</div>
</a>
</li>
<li class=" status-busy">
<a href="javascript:;">
<div class="user-img">
<img src="{% static 'dashboard/image/avatar-2.png' %}" alt="user-image"
class="img-circle img-inline">
</div>
<div>
<span class="name">
<strong>Linette Lheureux</strong>
<span class="time small">- 16th Mar</span>
<span class="profile-status busy pull-right"></span>
</span>
<span class="desc small">
Sometimes it takes a lifetime to win a battle.
</span>
</div>
</a>
</li>
<li class=" status-away">
<a href="javascript:;">
<div class="user-img">
<img src="{% static 'dashboard/image/avatar-3.png' %}" alt="user-image"
class="img-circle img-inline">
</div>
<div>
<span class="name">
<strong>Araceli Boatright</strong>
<span class="time small">- 16th Mar</span>
<span class="profile-status away pull-right"></span>
</span>
<span class="desc small">
Sometimes it takes a lifetime to win a battle.
</span>
</div>
</a>
</li>
</ul>
</li>
<li class="external">
<a href="javascript:;">
<span>Read All Messages</span>
</a>
</li>
</ul>
</li>
<li class="">
<a href="#" data-toggle="dropdown" class="toggle">
<i class="fa fa-bell"></i>
<span class="badge badge-orange">3</span>
</a>
<ul class="dropdown-menu notifications animated fadeIn">
<li class="total">
<span class="small">
You have <strong>3</strong> new notifications.
<a href="javascript:;" class="pull-right">Mark all as Read</a>
</span>
</li>
<li class="list">
<ul class="dropdown-menu-list list-unstyled ps-scrollbar">
<li class="unread available"> <!-- available: success, warning, info, error -->
<a href="javascript:;">
<div class="notice-icon">
<i class="fa fa-check"></i>
</div>
<div>
<span class="name">
<strong>Server needs to reboot</strong>
<span class="time small">15 mins ago</span>
</span>
</div>
</a>
</li>
<li class="unread away"> <!-- available: success, warning, info, error -->
<a href="javascript:;">
<div class="notice-icon">
<i class="fa fa-envelope"></i>
</div>
<div>
<span class="name">
<strong>45 new messages</strong>
<span class="time small">45 mins ago</span>
</span>
</div>
</a>
</li>
<li class=" busy"> <!-- available: success, warning, info, error -->
<a href="javascript:;">
<div class="notice-icon">
<i class="fa fa-times"></i>
</div>
<div>
<span class="name">
<strong>Server IP Blocked</strong>
<span class="time small">1 hour ago</span>
</span>
</div>
</a>
</li>
<li class=" offline"> <!-- available: success, warning, info, error -->
<a href="javascript:;">
<div class="notice-icon">
<i class="fa fa-user"></i>
</div>
<div>
<span class="name">
<strong>10 Orders Shipped</strong>
<span class="time small">5 hours ago</span>
</span>
</div>
</a>
</li>
<li class=" offline"> <!-- available: success, warning, info, error -->
<a href="javascript:;">
<div class="notice-icon">
<i class="fa fa-user"></i>
</div>
<div>
<span class="name">
<strong>New Comment on blog</strong>
<span class="time small">Yesterday</span>
</span>
</div>
</a>
</li>
<li class=" available"> <!-- available: success, warning, info, error -->
<a href="javascript:;">
<div class="notice-icon">
<i class="fa fa-check"></i>
</div>
<div>
<span class="name">
<strong>Great Speed Notify</strong>
<span class="time small">14th Mar</span>
</span>
</div>
</a>
</li>
<li class=" busy"> <!-- available: success, warning, info, error -->
<a href="javascript:;">
<div class="notice-icon">
<i class="fa fa-times"></i>
</div>
<div>
<span class="name">
<strong>Team Meeting at 6PM</strong>
<span class="time small">16th Mar</span>
</span>
</div>
</a>
</li>
</ul>
</li>
<li class="external">
<a href="javascript:;">
<span>Read All Notifications</span>
</a>
</li>
</ul>
</li>
<li class="hidden-sm hidden-xs searchform">
<div class="input-group">
<span class="input-group-addon input-focus">
<i class="fa fa-search"></i>
</span>
<form action="search-page.html" method="post">
<input type="text" class="form-control animated fadeIn" placeholder="Search & Enter">
<input type='submit' value="">
</form>
</div>
</li>
</ul>
</div>
<div class='pull-right'>
{% if user.is_authenticated %}
<ul class="info-menu right-links list-inline list-unstyled">
<li class="profile">
<a href="#" data-toggle="dropdown" class="toggle">
{% for u in user.userprofile_set.all %}
<img src="{{ u.image.url }}" alt="user-image"
class="img-circle img-inline">
{% endfor %}
<span><i class="fa fa-angle-down"></i></span>
</a>
<ul class="dropdown-menu profile animated fadeIn">
<li>
<a href="#settings">
<i class="fa fa-wrench"></i>
Settings
</a>
</li>
<li>
<a href="#profile">
<i class="fa fa-user"></i>
Profile
</a>
</li>
<li>
<a href="#help">
<i class="fa fa-info"></i>
Help
</a>
</li>
<li class="last">
<a href="{% url 'dashboard-logout' %}">
<i class="fa fa-lock"></i>
Logout
</a>
</li>
</ul>
</li>
<li class="chat-toggle-wrapper">
{# <a href="#" data-toggle="chatbar" class="toggle_chat">#}
<span>{{ user.first_name }}</span>
{# <i class="fa fa-comments"></i>#}
{# <span class="badge badge-warning">9</span>#}
{# </a>#}
</li>
</ul>
{% else %}
<div class='quick-area'>
<div class='pull-left'>
<ul class="info-menu left-links list-unstyled">
<li class="sidebar-toggle-wrap">
<a href="{% url 'dashboard-login' %}" style="margin-right: 50px">
<i class="glyphicon glyphicon-education">登录</i>
</a>
<a href="{% url 'dashboard-register' %}" style="margin-right: 10px">
<i class="glyphicon glyphicon-education">注册</i>
</a>
</li>
</ul>
</div>
</div>
{% endif %}
</div>
</div>
</div>
{% load static %}
<div class='page-topbar '>
<div class='logo-area'>
</div>
<div class='quick-area'>
<div class='pull-left'>
<ul class="info-menu left-links list-inline list-unstyled">
<li class="sidebar-toggle-wrap">
<a href="#" data-toggle="sidebar" class="sidebar_toggle">
<i class="fa fa-bars"></i>
</a>
</li>
<li class="">
<a href="#" data-toggle="dropdown" class="toggle">
<i class="fa fa-envelope"></i>
<span class="badge badge-primary">7</span>
</a>
<ul class="dropdown-menu messages animated fadeIn">
<li class="list">
<ul class="dropdown-menu-list list-unstyled ps-scrollbar">
<li class="unread status-available">
<a href="javascript:;">
<div class="user-img">
<img src="{% static 'dashboard/image/avatar-1.png' %}" alt="user-image"
class="img-circle img-inline">
</div>
<div>
<span class="name">
<strong>Clarine Vassar</strong>
<span class="time small">- 15 mins ago</span>
<span class="profile-status available pull-right"></span>
</span>
<span class="desc small">
Sometimes it takes a lifetime to win a battle.
</span>
</div>
</a>
</li>
<li class=" status-away">
<a href="javascript:;">
<div class="user-img">
<img src="{% static 'dashboard/image/avatar-2.png' %}" alt="user-image"
class="img-circle img-inline">
</div>
<div>
<span class="name">
<strong>Brooks Latshaw</strong>
<span class="time small">- 45 mins ago</span>
<span class="profile-status away pull-right"></span>
</span>
<span class="desc small">
Sometimes it takes a lifetime to win a battle.
</span>
</div>
</a>
</li>
<li class=" status-busy">
<a href="javascript:;">
<div class="user-img">
<img src="{% static 'dashboard/image/avatar-3.png' %}" alt="user-image"
class="img-circle img-inline">
</div>
<div>
<span class="name">
<strong>Clementina Brodeur</strong>
<span class="time small">- 1 hour ago</span>
<span class="profile-status busy pull-right"></span>
</span>
<span class="desc small">
Sometimes it takes a lifetime to win a battle.
</span>
</div>
</a>
</li>
<li class=" status-offline">
<a href="javascript:;">
<div class="user-img">
<img src="{% static 'dashboard/image/avatar-4.png' %}" alt="user-image"
class="img-circle img-inline">
</div>
<div>
<span class="name">
<strong>Carri Busey</strong>
<span class="time small">- 5 hours ago</span>
<span class="profile-status offline pull-right"></span>
</span>
<span class="desc small">
Sometimes it takes a lifetime to win a battle.
</span>
</div>
</a>
</li>
<li class=" status-offline">
<a href="javascript:;">
<div class="user-img">
<img src="{% static 'dashboard/image/avatar-5.png' %}" alt="user-image"
class="img-circle img-inline">
</div>
<div>
<span class="name">
<strong>Melissa Dock</strong>
<span class="time small">- Yesterday</span>
<span class="profile-status offline pull-right"></span>
</span>
<span class="desc small">
Sometimes it takes a lifetime to win a battle.
</span>
</div>
</a>
</li>
<li class=" status-available">
<a href="javascript:;">
<div class="user-img">
<img src="{% static 'dashboard/image/avatar-1.png' %}" alt="user-image"
class="img-circle img-inline">
</div>
<div>
<span class="name">
<strong>Verdell Rea</strong>
<span class="time small">- 14th Mar</span>
<span class="profile-status available pull-right"></span>
</span>
<span class="desc small">
Sometimes it takes a lifetime to win a battle.
</span>
</div>
</a>
</li>
<li class=" status-busy">
<a href="javascript:;">
<div class="user-img">
<img src="{% static 'dashboard/image/avatar-2.png' %}" alt="user-image"
class="img-circle img-inline">
</div>
<div>
<span class="name">
<strong>Linette Lheureux</strong>
<span class="time small">- 16th Mar</span>
<span class="profile-status busy pull-right"></span>
</span>
<span class="desc small">
Sometimes it takes a lifetime to win a battle.
</span>
</div>
</a>
</li>
<li class=" status-away">
<a href="javascript:;">
<div class="user-img">
<img src="{% static 'dashboard/image/avatar-3.png' %}" alt="user-image"
class="img-circle img-inline">
</div>
<div>
<span class="name">
<strong>Araceli Boatright</strong>
<span class="time small">- 16th Mar</span>
<span class="profile-status away pull-right"></span>
</span>
<span class="desc small">
Sometimes it takes a lifetime to win a battle.
</span>
</div>
</a>
</li>
</ul>
</li>
<li class="external">
<a href="javascript:;">
<span>Read All Messages</span>
</a>
</li>
</ul>
</li>
<li class="">
<a href="#" data-toggle="dropdown" class="toggle">
<i class="fa fa-bell"></i>
<span class="badge badge-orange">3</span>
</a>
<ul class="dropdown-menu notifications animated fadeIn">
<li class="total">
<span class="small">
You have <strong>3</strong> new notifications.
<a href="javascript:;" class="pull-right">Mark all as Read</a>
</span>
</li>
<li class="list">
<ul class="dropdown-menu-list list-unstyled ps-scrollbar">
<li class="unread available"> <!-- available: success, warning, info, error -->
<a href="javascript:;">
<div class="notice-icon">
<i class="fa fa-check"></i>
</div>
<div>
<span class="name">
<strong>Server needs to reboot</strong>
<span class="time small">15 mins ago</span>
</span>
</div>
</a>
</li>
<li class="unread away"> <!-- available: success, warning, info, error -->
<a href="javascript:;">
<div class="notice-icon">
<i class="fa fa-envelope"></i>
</div>
<div>
<span class="name">
<strong>45 new messages</strong>
<span class="time small">45 mins ago</span>
</span>
</div>
</a>
</li>
<li class=" busy"> <!-- available: success, warning, info, error -->
<a href="javascript:;">
<div class="notice-icon">
<i class="fa fa-times"></i>
</div>
<div>
<span class="name">
<strong>Server IP Blocked</strong>
<span class="time small">1 hour ago</span>
</span>
</div>
</a>
</li>
<li class=" offline"> <!-- available: success, warning, info, error -->
<a href="javascript:;">
<div class="notice-icon">
<i class="fa fa-user"></i>
</div>
<div>
<span class="name">
<strong>10 Orders Shipped</strong>
<span class="time small">5 hours ago</span>
</span>
</div>
</a>
</li>
<li class=" offline"> <!-- available: success, warning, info, error -->
<a href="javascript:;">
<div class="notice-icon">
<i class="fa fa-user"></i>
</div>
<div>
<span class="name">
<strong>New Comment on blog</strong>
<span class="time small">Yesterday</span>
</span>
</div>
</a>
</li>
<li class=" available"> <!-- available: success, warning, info, error -->
<a href="javascript:;">
<div class="notice-icon">
<i class="fa fa-check"></i>
</div>
<div>
<span class="name">
<strong>Great Speed Notify</strong>
<span class="time small">14th Mar</span>
</span>
</div>
</a>
</li>
<li class=" busy"> <!-- available: success, warning, info, error -->
<a href="javascript:;">
<div class="notice-icon">
<i class="fa fa-times"></i>
</div>
<div>
<span class="name">
<strong>Team Meeting at 6PM</strong>
<span class="time small">16th Mar</span>
</span>
</div>
</a>
</li>
</ul>
</li>
<li class="external">
<a href="javascript:;">
<span>Read All Notifications</span>
</a>
</li>
</ul>
</li>
<li class="hidden-sm hidden-xs searchform">
<div class="input-group">
<span class="input-group-addon input-focus">
<i class="fa fa-search"></i>
</span>
<form action="search-page.html" method="post">
<input type="text" class="form-control animated fadeIn" placeholder="Search & Enter">
<input type='submit' value="">
</form>
</div>
</li>
</ul>
</div>
<div class='pull-right'>
{% if user.is_authenticated %}
<ul class="info-menu right-links list-inline list-unstyled">
<li class="profile">
<a href="#" data-toggle="dropdown" class="toggle">
{% for u in user.userprofile_set.all %}
<img src="{{ u.image.url }}" alt="user-image"
class="img-circle img-inline">
{% endfor %}
<span><i class="fa fa-angle-down"></i></span>
</a>
<ul class="dropdown-menu profile animated fadeIn">
<li>
<a href="#settings">
<i class="fa fa-wrench"></i>
Settings
</a>
</li>
<li>
<a href="#profile">
<i class="fa fa-user"></i>
Profile
</a>
</li>
<li>
<a href="#help">
<i class="fa fa-info"></i>
Help
</a>
</li>
<li class="last">
<a href="{% url 'dashboard-logout' %}">
<i class="fa fa-lock"></i>
Logout
</a>
</li>
</ul>
</li>
<li class="chat-toggle-wrapper">
{# <a href="#" data-toggle="chatbar" class="toggle_chat">#}
{% for i in user.userprofile_set.all %}
<span>{{ i.name }}</span>
{% endfor %}
{# <i class="fa fa-comments"></i>#}
{# <span class="badge badge-warning">9</span>#}
{# </a>#}
</li>
</ul>
{% else %}
<div class='quick-area'>
<div class='pull-left'>
<ul class="info-menu left-links list-unstyled">
<li class="sidebar-toggle-wrap">
<a href="{% url 'dashboard-login' %}" style="margin-right: 50px">
<i class="glyphicon glyphicon-education">登录</i>
</a>
<a href="{% url 'dashboard-register' %}" style="margin-right: 10px">
<i class="glyphicon glyphicon-education">注册</i>
</a>
</li>
</ul>
</div>
</div>
{% endif %}
</div>
</div>
</div>

View File

@ -1,188 +1,194 @@
<div class="page-sidebar-wrapper" id="main-menu-wrapper" style="min-height: 1000px">
<!-- USER INFO - START -->
<div class="profile-info row">
<div class="profile-image col-md-4 col-sm-4 col-xs-4">
<a href="{% url 'dashboard-index' %}">
{% for u in user.userprofile_set.all %}
<img src="{{ u.image.url }}" class="img-responsive img-circle">
{% endfor %}
</a>
</div>
<div class="profile-details col-md-8 col-sm-8 col-xs-8">
<h3>
<a href="#">{{ user.username }}</a>
<!-- Available statuses: online, idle, busy, away and offline -->
<span class="profile-status online"></span>
</h3>
{% for u in user.userprofile_set.all %}
<p class="profile-title">{{ u.organization }}</p>
{% endfor %}
</div>
</div>
<!-- USER INFO - END -->
<ul class='wraplist'>
<li class="open">
<a href="javascript:;">
<i class="fa fa-map-marker"></i>
<span class="title">发布时效性监测</span>
<span class="arrow "></span>
</a>
<ul class="sub-menu">
<li>
<a class="" href="">新媒体详情监测</a>
</li>
</ul>
</li>
<li class="">
<a href="">
<i class="fa fa-dashboard"></i>
<span class="title">错别字监测</span>
</a>
</li>
<li class="">
<a href="javascript:;">
<i class="fa fa-map-marker"></i>
<span class="title">敏感信息监测</span>
<span class="arrow "></span>
</a>
<ul class="sub-menu">
<li>
<a class="" href="">会议详情</a>
</li>
</ul>
</li>
<li class="">
<a href="javascript:;">
<i class="fa fa-suitcase"></i>
<span class="title">监测报告</span>
<span class="arrow "></span>
</a>
<ul class="sub-menu">
<li>
<a class="" href="">详情</a>
</li>
</ul>
</li>
<li class="">
<a href="javascript:;">
<i class="fa fa-sliders"></i>
<span class="title">群组管理</span>
<span class="arrow "></span>
</a>
<ul class="sub-menu">
<li>
<a class="" href="{% url 'group-management-create' %}">新建群组</a>
</li>
<li>
<a class="" href="{% url 'group-management-management' %}">编辑群组</a>
</li>
<li>
<a class="" href="">搜索添加单位</a>
</li>
</ul>
</li>
<li class="">
<a href="javascript:;">
<i class="fa fa-gift"></i>
<span class="title">新媒体管理</span>
<span class="arrow "></span><span class="label label-orange">NEW</span>
</a>
<ul class="sub-menu">
<li>
<a class="" href="{% url 'newmedia-management-create-menu' %}">新建新媒体</a>
</li>
<li>
<a class="" href="{% url 'newmedia-management-edit-menu' %}">编辑新媒体</a>
</li>
</ul>
</li>
<li class="">
<a href="javascript:;">
<i class="fa fa-envelope"></i>
<span class="title">主体单位管理</span>
<span class="arrow "></span><span class="label label-orange">4</span>
</a>
<ul class="sub-menu">
<li>
<a class="" href="{% url 'organization-management-create' %}">新建单位</a>
</li>
<li>
<a class="" href="">搜索添加用户</a>
</li>
<li>
<a class="" href="{% url 'organization-management-management' %}">编辑单位</a>
</li>
</ul>
</li>
<li class="">
<a href="{% url 'user-management-management' %}">
<i class="fa fa-dashboard"></i>
<span class="title">用户管理</span>
</a>
</li>
<li class="">
<a href="">
<i class="fa fa-dashboard"></i>
<span class="title">系统设置</span>
</a>
</li>
<li class="">
<a href="javascript:;">
<i class="fa fa-columns"></i>
<span class="title">工作首页</span>
<span class="arrow "></span>
</a>
<ul class="sub-menu">
<li>
<a class="" href="">工作列表</a>
</li>
<li>
<a class="" href="">考勤管理</a>
</li>
<li>
<a class="" href="">新闻管理</a>
</li>
</ul>
</li>
{# <li class=""><a href="javascript:;"> <i class="fa fa-folder-open"></i> <span class="title">Menu Levels</span>#}
{# <span class="arrow "></span> </a>#}
{# <ul class="sub-menu">#}
{# <li><a href="javascript:;"> <span class="title">Level 1.1</span> </a></li>#}
{# <li><a href="javascript:;"> <span class="title">Level 1.2</span> <span#}
{# class="arrow "></span> </a>#}
{# <ul class="sub-menu">#}
{# <li><a href="javascript:;"> <span class="title">Level 2.1</span> </a></li>#}
{# <li><a href="ujavascript:;"> <span class="title">Level 2.2</span> <span#}
{# class="arrow "></span></a>#}
{# <ul class="sub-menu">#}
{# <li><a href="javascript:;"> <span class="title">Level 3.1</span> <span#}
{# class="arrow "></span></a>#}
{# <ul class="sub-menu">#}
{# <li><a href="ujavascript:;"> <span class="title">Level 4.1</span>#}
{# </a></li>#}
{# <li><a href="ujavascript:;"> <span class="title">Level 4.2</span>#}
{# </a></li>#}
{# </ul>#}
{# </li>#}
{# <li><a href="ujavascript:;"> <span class="title">Level 3.2</span> </a></li>#}
{# </ul>#}
{# </li>#}
{# </ul>#}
{# </li>#}
{# </ul>#}
{# </li>#}
</ul>
</div>
<div class="page-sidebar-wrapper" id="main-menu-wrapper" style="min-height: 1000px">
<!-- USER INFO - START -->
<div class="profile-info row">
<div class="profile-image col-md-4 col-sm-4 col-xs-4">
<a href="{% url 'dashboard-index' %}">
{% for u in user.userprofile_set.all %}
<img src="{{ u.image.url }}" class="img-responsive img-circle">
{% endfor %}
</a>
</div>
<div class="profile-details col-md-8 col-sm-8 col-xs-8">
<h3>
<a href="#">{{ user.username }}</a>
<!-- Available statuses: online, idle, busy, away and offline -->
<span class="profile-status online"></span>
</h3>
{% for u in user.userprofile_set.all %}
<p class="profile-title">{{ u.organization }}</p>
{% endfor %}
</div>
</div>
<!-- USER INFO - END -->
<ul class='wraplist'>
<li class="">
<a href="{% url 'user-management-update' user.id %}">
<i class="fa fa-th"></i>
<span class="title">新媒体舆情</span>
</a>
</li>
{# <li class="open">#}
<li class="">
<a href="javascript:;">
<i class="fa fa-map-marker"></i>
<span class="title">发布时效性监测</span>
<span class="arrow "></span>
</a>
<ul class="sub-menu">
<li>
<a class="" href="">新媒体详情监测</a>
</li>
</ul>
</li>
<li class="">
<a href="">
<i class="fa fa-bar-chart"></i>
<span class="title">错别字监测</span>
</a>
</li>
<li class="">
<a href="javascript:;">
<i class="fa fa-folder-open"></i>
<span class="title">敏感信息监测</span>
<span class="arrow "></span>
</a>
<ul class="sub-menu">
<li>
<a class="" href="">会议详情</a>
</li>
</ul>
</li>
<li class="">
<a href="javascript:;">
<i class="fa fa-suitcase"></i>
<span class="title">监测报告</span>
<span class="arrow "></span>
</a>
<ul class="sub-menu">
<li>
<a class="" href="">详情</a>
</li>
</ul>
</li>
<li class="">
<a href="javascript:;">
<i class="fa fa-sliders"></i>
<span class="title">群组管理</span>
<span class="arrow "></span>
</a>
<ul class="sub-menu">
<li>
<a class="" href="{% url 'group-management-create' %}">新建群组</a>
</li>
<li>
<a class="" href="{% url 'group-management-management' %}">编辑群组</a>
</li>
<li>
<a class="" href="">搜索添加单位</a>
</li>
</ul>
</li>
<li class="">
<a href="javascript:;">
<i class="fa fa-gift"></i>
<span class="title">新媒体管理</span>
<span class="arrow "></span><span class="label label-orange">NEW</span>
</a>
<ul class="sub-menu">
<li>
<a class="" href="{% url 'newmedia-management-create-menu' %}">新建新媒体</a>
</li>
<li>
<a class="" href="{% url 'newmedia-management-edit-menu' %}">编辑新媒体</a>
</li>
</ul>
</li>
<li class="">
<a href="javascript:;">
<i class="fa fa-envelope"></i>
<span class="title">主体单位管理</span>
<span class="arrow "></span><span class="label label-orange">4</span>
</a>
<ul class="sub-menu">
<li>
<a class="" href="{% url 'organization-management-create' %}">新建单位</a>
</li>
<li>
<a class="" href="">搜索添加用户</a>
</li>
<li>
<a class="" href="{% url 'organization-management-management' %}">编辑单位</a>
</li>
</ul>
</li>
<li class="">
<a href="{% url 'user-management-management' %}">
<i class="fa fa-columns"></i>
<span class="title">用户管理</span>
</a>
</li>
<li class="">
<a href="{% url 'user-management-update' user.id %}">
<i class="fa fa-dashboard"></i>
<span class="title">系统设置</span>
</a>
</li>
{# <li class="">#}
{# <a href="javascript:;">#}
{# <i class="fa fa-columns"></i>#}
{# <span class="title">工作首页</span>#}
{# <span class="arrow "></span>#}
{# </a>#}
{# <ul class="sub-menu">#}
{# <li>#}
{# <a class="" href="">工作列表</a>#}
{# </li>#}
{# <li>#}
{# <a class="" href="">考勤管理</a>#}
{# </li>#}
{# <li>#}
{# <a class="" href="">新闻管理</a>#}
{# </li>#}
{# </ul>#}
{# </li>#}
{# <li class=""><a href="javascript:;"> <i class="fa fa-folder-open"></i> <span class="title">Menu Levels</span>#}
{# <span class="arrow "></span> </a>#}
{# <ul class="sub-menu">#}
{# <li><a href="javascript:;"> <span class="title">Level 1.1</span> </a></li>#}
{# <li><a href="javascript:;"> <span class="title">Level 1.2</span> <span#}
{# class="arrow "></span> </a>#}
{# <ul class="sub-menu">#}
{# <li><a href="javascript:;"> <span class="title">Level 2.1</span> </a></li>#}
{# <li><a href="ujavascript:;"> <span class="title">Level 2.2</span> <span#}
{# class="arrow "></span></a>#}
{# <ul class="sub-menu">#}
{# <li><a href="javascript:;"> <span class="title">Level 3.1</span> <span#}
{# class="arrow "></span></a>#}
{# <ul class="sub-menu">#}
{# <li><a href="ujavascript:;"> <span class="title">Level 4.1</span>#}
{# </a></li>#}
{# <li><a href="ujavascript:;"> <span class="title">Level 4.2</span>#}
{# </a></li>#}
{# </ul>#}
{# </li>#}
{# <li><a href="ujavascript:;"> <span class="title">Level 3.2</span> </a></li>#}
{# </ul>#}
{# </li>#}
{# </ul>#}
{# </li>#}
{# </ul>#}
{# </li>#}
</ul>
</div>

File diff suppressed because it is too large Load Diff

View File

@ -1,149 +1,149 @@
{% extends 'dashboard/base/base.html' %}
{% load static %}
{% block css %}
<style>
body.login_page {
background-color: rgba(116, 77, 144, 1.0)
/*#744d90*/;
background-image: url('{% static 'image/login-bg.png' %}');
background-attachment: fixed;
height: 100%;
max-height: 100%;
min-height: 99%;
overflow: hidden;
width: 100%;
}
.loginpage h1 a {
height: 92px;
margin: 0px auto 0px auto;
padding: 0;
text-decoration: none;
-moz-background-size: 345px 92px;
-o-background-size: 345px 92px;
background-size: 345px 92px;
background-color: transparent;
min-height: 92px;
width: auto;
background-image: url("{% static 'image/login-logo.png' %}");
background-position: center top;
background-repeat: no-repeat;
text-indent: -9999px;
outline: 0;
overflow: hidden;
display: block;
}
</style>
{% endblock %}
{% block header %} {% endblock %}
{% block content %}
<body class=" login_page">
<div class="login-wrapper">
{% if messages %}
<div class="alert alert-success alert-dismissible" role="alert">
<button type="button" class="close" data-dismiss="alert">
<span aria-hidden="true">&times;</span>
<span class="sr-only">Close</span>
</button>
{% for message in messages %}
{{ message }}.<br/>
{% endfor %}
</div>
{% endif %}
<div id="login"
class="login loginpage col-lg-offset-4 col-lg-4 col-md-offset-3 col-md-6 col-sm-offset-3 col-sm-6 col-xs-offset-2 col-xs-8">
<h1><a href="#" title="Login Page" tabindex="-1">Ultra Admin</a></h1>
<form name="loginform" id="loginform" action="{% url 'dashboard-login' %}" method="post">{% csrf_token %}
<p>
<label for="user_login">账号(您的邮箱、手机号或用户名)<br/>
<input type="text" name="username" id="user_login" class="input" size="20" placeholder="请输入账号"/></label>
</p>
<p>
<label for="user_pass">密码<br/>
<input type="password" name="password" id="user_pass" class="input" size="20"
placeholder="请输入密码"/></label>
</p>
<p class="div_index_yan">
<span>
<a href="#" class="next-captcha">
<img src="{{ image_url }}" class="captcha" alt="captcha">
</a>
</span>
<input id="id_reg_captcha_0" name="captcha_0" type="hidden" value="{{ hash_key }}">
<input type="text" id="id_reg_captcha_1" name="captcha_1" placeholder="验证码">
</p>
<p class="forgetmenot">
<label class="icheck-label form-label" for="rememberme"><input name="rememberme" type="checkbox"
id="rememberme" value="forever"
class="skin-square-orange" checked>
记住密码</label>
</p>
<p class="submit">
<input type="submit" name="wp-submit" id="wp-submit" class="btn btn-orange btn-block"
value="登录"/>
</p>
</form>
<p id="nav">
<a class="pull-left" href="#" title="Password Lost and Found">忘记密码</a>
<a class="pull-right" href="{% url 'dashboard-register' %}" title="Sign Up">注册</a>
</p>
</div>
</div>
<!-- LOAD FILES AT PAGE END FOR FASTER LOADING -->
<!-- General section box modal start -->
<div class="modal" id="section-settings" tabindex="-1" role="dialog" aria-labelledby="ultraModal-Label"
aria-hidden="true">
<div class="modal-dialog animated bounceInDown">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
<h4 class="modal-title">Section Settings</h4>
</div>
<div class="modal-body">
Body goes here...
</div>
<div class="modal-footer">
<button data-dismiss="modal" class="btn btn-default" type="button">Close</button>
<button class="btn btn-success" type="button">Save changes</button>
</div>
</div>
</div>
</div>
<!-- modal end -->
</body>
{% endblock %}
{% block add_js %}
<script>
$(function () {
$(".next-captcha").click(function (e) {
e.preventDefault();
$.getJSON("{% url 'refresh-captcha' %}", function (json) {
// This should update your captcha image src and captcha hidden input
// debugger;
var status = json['status'];
console.log(status);
console.log("6666666666666666666666666666666");
var new_cptch_key = json['new_cptch_key'];
var new_cptch_image = json['new_cptch_image'];
id_captcha_0 = $("#id_reg_captcha_0");
img = $(".captcha");
id_captcha_0.attr("value", new_cptch_key);
img.attr("src", new_cptch_image);
});
});
})
</script>
{% endblock %}
{% extends 'dashboard/base/base.html' %}
{% load static %}
{% block css %}
<style>
body.login_page {
background-color: rgba(116, 77, 144, 1.0)
/*#744d90*/;
background-image: url('{% static 'image/login-bg.png' %}');
background-attachment: fixed;
height: 100%;
max-height: 100%;
min-height: 99%;
overflow: hidden;
width: 100%;
}
.loginpage h1 a {
height: 92px;
margin: 0px auto 0px auto;
padding: 0;
text-decoration: none;
-moz-background-size: 345px 92px;
-o-background-size: 345px 92px;
background-size: 345px 92px;
background-color: transparent;
min-height: 92px;
width: auto;
background-image: url("{% static 'image/login-logo.png' %}");
background-position: center top;
background-repeat: no-repeat;
text-indent: -9999px;
outline: 0;
overflow: hidden;
display: block;
}
</style>
{% endblock %}
{% block header %} {% endblock %}
{% block content %}
<body class=" login_page">
<div class="login-wrapper">
{% if messages %}
<div class="alert alert-success alert-dismissible" role="alert">
<button type="button" class="close" data-dismiss="alert">
<span aria-hidden="true">&times;</span>
<span class="sr-only">Close</span>
</button>
{% for message in messages %}
{{ message }}.<br/>
{% endfor %}
</div>
{% endif %}
<div id="login"
class="login loginpage col-lg-offset-4 col-lg-4 col-md-offset-3 col-md-6 col-sm-offset-3 col-sm-6 col-xs-offset-2 col-xs-8">
<h1><a href="#" title="Login Page" tabindex="-1">Ultra Admin</a></h1>
<form name="loginform" id="loginform" action="{% url 'dashboard-login' %}" method="post">{% csrf_token %}
<p>
<label for="user_login">账号(您注册的手机号)<br/>
<input type="text" name="username" id="user_login" class="input" size="20" placeholder="请输入账号"/></label>
</p>
<p>
<label for="user_pass">密码<br/>
<input type="password" name="password" id="user_pass" class="input" size="20"
placeholder="请输入密码"/></label>
</p>
<p class="div_index_yan">
<span>
<a href="#" class="next-captcha">
<img src="{{ image_url }}" class="captcha" alt="captcha">
</a>
</span>
<input id="id_reg_captcha_0" name="captcha_0" type="hidden" value="{{ hash_key }}">
<input type="text" id="id_reg_captcha_1" name="captcha_1" placeholder="验证码">
</p>
<p class="forgetmenot">
<label class="icheck-label form-label" for="rememberme"><input name="rememberme" type="checkbox"
id="rememberme" value="forever"
class="skin-square-orange" checked>
记住密码</label>
</p>
<p class="submit">
<input type="submit" name="wp-submit" id="wp-submit" class="btn btn-orange btn-block"
value="登录"/>
</p>
</form>
<p id="nav">
<a class="pull-left" href="#" title="Password Lost and Found">忘记密码</a>
<a class="pull-right" href="{% url 'dashboard-register' %}" title="Sign Up">注册</a>
</p>
</div>
</div>
<!-- LOAD FILES AT PAGE END FOR FASTER LOADING -->
<!-- General section box modal start -->
<div class="modal" id="section-settings" tabindex="-1" role="dialog" aria-labelledby="ultraModal-Label"
aria-hidden="true">
<div class="modal-dialog animated bounceInDown">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
<h4 class="modal-title">Section Settings</h4>
</div>
<div class="modal-body">
Body goes here...
</div>
<div class="modal-footer">
<button data-dismiss="modal" class="btn btn-default" type="button">Close</button>
<button class="btn btn-success" type="button">Save changes</button>
</div>
</div>
</div>
</div>
<!-- modal end -->
</body>
{% endblock %}
{% block add_js %}
<script>
$(function () {
$(".next-captcha").click(function (e) {
e.preventDefault();
$.getJSON("{% url 'refresh-captcha' %}", function (json) {
// This should update your captcha image src and captcha hidden input
// debugger;
var status = json['status'];
console.log(status);
console.log("6666666666666666666666666666666");
var new_cptch_key = json['new_cptch_key'];
var new_cptch_image = json['new_cptch_image'];
id_captcha_0 = $("#id_reg_captcha_0");
img = $(".captcha");
id_captcha_0.attr("value", new_cptch_key);
img.attr("src", new_cptch_image);
});
});
})
</script>
{% endblock %}

View File

@ -1,188 +1,188 @@
{% extends 'dashboard/base/base.html' %}
{% load static %}
{% block css %}
<style>
body.login_page {
background-color: rgba(116, 77, 144, 1.0)
/*#744d90*/;
background-image: url('{% static 'image/login-bg.png' %}');
background-attachment: fixed;
height: 100%;
max-height: 100%;
min-height: 99%;
overflow: hidden;
width: 100%;
}
.loginpage h1 a {
height: 92px;
margin: 0px auto 0px auto;
padding: 0;
text-decoration: none;
-moz-background-size: 345px 92px;
-o-background-size: 345px 92px;
background-size: 345px 92px;
background-color: transparent;
min-height: 92px;
width: auto;
background-image: url("{% static 'image/login-logo.png' %}");
background-position: center top;
background-repeat: no-repeat;
text-indent: -9999px;
outline: 0;
overflow: hidden;
display: block;
}
</style>
{% endblock %}
{% block header %}{% endblock %}
{% block content %}
<body class=" login_page">
<div class="register-wrapper">
{% if messages %}
<div class="alert alert-danger alert-dismissible" role="alert">
<button type="button" class="close" data-dismiss="alert">
<span aria-hidden="true">&times;</span>
<span class="sr-only">Close</span>
</button>
{% for message in messages %}
{{ message }}.<br/>
{% endfor %}
</div>
{% endif %}
<div id="register"
class="login loginpage col-lg-offset-4 col-lg-4 col-md-offset-3 col-md-6 col-sm-offset-3 col-sm-6 col-xs-offset-2 col-xs-8">
<h1><a href="#" title="Login Page" tabindex="-1">Ultra Admin</a></h1>
<form name="loginform" id="loginform" action="{% url 'dashboard-register' %}" method="post"
enctype="multipart/form-data">{% csrf_token %}
<p>
<label for="name">单位<br/>
<select class="form-control" name="organization">
{% for o in organization %}
<option value="{{ o.id }}">{{ o.name }}</option>
{% endfor %}
</select>
</label>
</p>
<p>
<label for="name">姓名<br/>
<input type="text" name="name" id="user_login" class="input" value="" size="20"/></label>
</p>
<p>
<label for="sex">性别<br/>
<label style="text-align: center">
<input type="radio" name="sex" id="inlineRadio1" value="1" checked="checked">
<input type="radio" name="sex" id="inlineRadio2" value="2" style="margin-left: 50px">
</label>
</label>
</p>
<p>
<label for="email">邮箱<br/>
<input type="text" name="email" id="user_login" class="input" value="" size="20"/></label>
</p>
<p>
<label for="phone">电话<br/>
<input type="text" name="phone" id="user_login" class="input" value="" size="20"/></label>
</p>
<p>
<label for="username">用户名<br/>
<input type="text" name="username" id="user_login" class="input" value="" size="20"/></label>
</p>
<p>
<label for="password">密码<br/>
<input type="password" name="password" id="user_pass" class="input" value="" size="20"/></label>
</p>
<p>
<label for="confirm_password">确认密码<br/>
<input type="password" name="confirm_password" id="user_pass1" class="input" value=""
size="20"/></label>
</p>
<p>
<label for="image">头像<br/>
<input type="file" id="exampleInputFile" name="image"></label>
</p>
<p class="div_index_yan">
<span>
<a href="#" class="next-captcha">
<img src="{{ image_url }}" class="captcha" alt="captcha">
</a>
</span>
<input id="id_reg_captcha_0" name="captcha_0" type="hidden" value="{{ hash_key }}">
<input type="text" id="id_reg_captcha_1" name="captcha_1" placeholder="验证码">
</p>
<p class="forgetmenot">
<label class="icheck-label form-label" for="rememberme"><input name="rememberme" type="checkbox"
id="rememberme" value="forever"
class="skin-square-orange" checked> I
agree to terms to conditions</label>
</p>
<p class="submit">
<input type="submit" name="wp-submit" id="wp-submit" class="btn btn-orange btn-block"
value="注册"/>
</p>
</form>
<p id="nav">
<a class="pull-left" href="#" title="Password Lost and Found">忘记密码</a>
<a class="pull-right" href="{% url 'dashboard-login' %}" title="Sign Up">登录</a>
</p>
<div class="clearfix"></div>
</div>
</div>
<!-- General section box modal start -->
<div class="modal" id="section-settings" tabindex="-1" role="dialog" aria-labelledby="ultraModal-Label"
aria-hidden="true">
<div class="modal-dialog animated bounceInDown">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
<h4 class="modal-title">Section Settings</h4>
</div>
<div class="modal-body">
Body goes here...
</div>
<div class="modal-footer">
<button data-dismiss="modal" class="btn btn-default" type="button">Close</button>
<button class="btn btn-success" type="button">Save changes</button>
</div>
</div>
</div>
</div>
<!-- modal end -->
</body>
{% endblock %}
{% block add_js %}
<script>
$(function () {
$(".next-captcha").click(function (e) {
e.preventDefault();
$.getJSON("{% url 'refresh-captcha' %}", function (json) {
// This should update your captcha image src and captcha hidden input
// debugger;
var status = json['status'];
console.log(status);
console.log("6666666666666666666666666666666");
var new_cptch_key = json['new_cptch_key'];
var new_cptch_image = json['new_cptch_image'];
id_captcha_0 = $("#id_reg_captcha_0");
img = $(".captcha");
id_captcha_0.attr("value", new_cptch_key);
img.attr("src", new_cptch_image);
});
});
})
</script>
{% endblock %}
{% extends 'dashboard/base/base.html' %}
{% load static %}
{% block css %}
<style>
body.login_page {
background-color: rgba(116, 77, 144, 1.0)
/*#744d90*/;
background-image: url('{% static 'image/login-bg.png' %}');
background-attachment: fixed;
height: 100%;
max-height: 100%;
min-height: 99%;
overflow: hidden;
width: 100%;
}
.loginpage h1 a {
height: 92px;
margin: 0px auto 0px auto;
padding: 0;
text-decoration: none;
-moz-background-size: 345px 92px;
-o-background-size: 345px 92px;
background-size: 345px 92px;
background-color: transparent;
min-height: 92px;
width: auto;
background-image: url("{% static 'image/login-logo.png' %}");
background-position: center top;
background-repeat: no-repeat;
text-indent: -9999px;
outline: 0;
overflow: hidden;
display: block;
}
</style>
{% endblock %}
{% block header %}{% endblock %}
{% block content %}
<body class=" login_page">
<div class="register-wrapper">
{% if messages %}
<div class="alert alert-danger alert-dismissible" role="alert">
<button type="button" class="close" data-dismiss="alert">
<span aria-hidden="true">&times;</span>
<span class="sr-only">Close</span>
</button>
{% for message in messages %}
{{ message }}.<br/>
{% endfor %}
</div>
{% endif %}
<div id="register"
class="login loginpage col-lg-offset-4 col-lg-4 col-md-offset-3 col-md-6 col-sm-offset-3 col-sm-6 col-xs-offset-2 col-xs-8">
<h1><a href="#" title="Login Page" tabindex="-1">Ultra Admin</a></h1>
<form name="loginform" id="loginform" action="{% url 'dashboard-register' %}" method="post"
enctype="multipart/form-data">{% csrf_token %}
<p>
<label for="name">单位<br/>
<select class="form-control" name="organization">
{% for o in organization %}
<option value="{{ o.id }}">{{ o.name }}</option>
{% endfor %}
</select>
</label>
</p>
<p>
<label for="name">姓名<br/>
<input type="text" name="name" id="user_login" class="input" value="" size="20"/></label>
</p>
<p>
<label for="sex">性别<br/>
<label style="text-align: center">
<input type="radio" name="sex" id="inlineRadio1" value="1" checked="checked">
<input type="radio" name="sex" id="inlineRadio2" value="2" style="margin-left: 50px">
</label>
</label>
</p>
<p>
<label for="email">邮箱<br/>
<input type="text" name="email" id="user_login" class="input" value="" size="20"/></label>
</p>
<p>
<label for="phone">电话<br/>
<input type="text" name="username" id="user_login" class="input" value="" size="20"/></label>
</p>
{# <p>#}
{# <label for="username">用户名<br/>#}
{# <input type="text" name="username" id="user_login" class="input" value="" size="20"/></label>#}
{# </p>#}
<p>
<label for="password">密码<br/>
<input type="password" name="password" id="user_pass" class="input" value="" size="20"/></label>
</p>
<p>
<label for="confirm_password">确认密码<br/>
<input type="password" name="confirm_password" id="user_pass1" class="input" value=""
size="20"/></label>
</p>
<p>
<label for="image">头像<br/>
<input type="file" id="exampleInputFile" name="image"></label>
</p>
<p class="div_index_yan">
<span>
<a href="#" class="next-captcha">
<img src="{{ image_url }}" class="captcha" alt="captcha">
</a>
</span>
<input id="id_reg_captcha_0" name="captcha_0" type="hidden" value="{{ hash_key }}">
<input type="text" id="id_reg_captcha_1" name="captcha_1" placeholder="验证码">
</p>
<p class="forgetmenot">
<label class="icheck-label form-label" for="rememberme"><input name="rememberme" type="checkbox"
id="rememberme" value="forever"
class="skin-square-orange" checked> I
agree to terms to conditions</label>
</p>
<p class="submit">
<input type="submit" name="wp-submit" id="wp-submit" class="btn btn-orange btn-block"
value="注册"/>
</p>
</form>
<p id="nav">
<a class="pull-left" href="#" title="Password Lost and Found">忘记密码</a>
<a class="pull-right" href="{% url 'dashboard-login' %}" title="Sign Up">登录</a>
</p>
<div class="clearfix"></div>
</div>
</div>
<!-- General section box modal start -->
<div class="modal" id="section-settings" tabindex="-1" role="dialog" aria-labelledby="ultraModal-Label"
aria-hidden="true">
<div class="modal-dialog animated bounceInDown">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
<h4 class="modal-title">Section Settings</h4>
</div>
<div class="modal-body">
Body goes here...
</div>
<div class="modal-footer">
<button data-dismiss="modal" class="btn btn-default" type="button">Close</button>
<button class="btn btn-success" type="button">Save changes</button>
</div>
</div>
</div>
</div>
<!-- modal end -->
</body>
{% endblock %}
{% block add_js %}
<script>
$(function () {
$(".next-captcha").click(function (e) {
e.preventDefault();
$.getJSON("{% url 'refresh-captcha' %}", function (json) {
// This should update your captcha image src and captcha hidden input
// debugger;
var status = json['status'];
console.log(status);
console.log("6666666666666666666666666666666");
var new_cptch_key = json['new_cptch_key'];
var new_cptch_image = json['new_cptch_image'];
id_captcha_0 = $("#id_reg_captcha_0");
img = $(".captcha");
id_captcha_0.attr("value", new_cptch_key);
img.attr("src", new_cptch_image);
});
});
})
</script>
{% endblock %}

View File

@ -48,10 +48,11 @@ def user_login(request):
except CaptchaStore.DoesNotExist:
messages.error(request, '验证码错误')
return HttpResponseRedirect('/login/')
print(username,password)
if username is not None and password is not None:
try:
# user = authenticate(username=username, password=password)
user = User.objects.get(Q(username=username) | Q(first_name=username) | Q(email=username))
user = authenticate(username=username, password=password)
# user = User.objects.get(username=phone)
if user is not None:
if user.check_password(password):
login(request, user)
@ -61,7 +62,7 @@ def user_login(request):
else:
messages.error(request, '账号或密码错误,请您确认账号和密码')
except:
messages.error(request, '账号或密码错误,请您确认账号和密码')
messages.error(request, '111')
return render(request,'dashboard/login.html',{'hash_key':hash_key,'image_url':image_url})
def user_logout(request):
logout(request)
@ -72,7 +73,7 @@ def register(request):
password = None
confirm_password = None
name = None
phone = None
# phone = None
image = None
flag = False
o = None
@ -93,10 +94,10 @@ def register(request):
messages.error(request, '请输入邮箱')
else:
email = request.POST.get('email')
if not request.POST.get('phone'):
messages.error(request, '请输入电话')
else:
phone = request.POST.get('phone')
# if not request.POST.get('phone'):
# messages.error(request, '请输入电话')
# else:
# phone = request.POST.get('phone')
if not request.POST.get('username'):
messages.error(request, '请输入用户名')
else:
@ -115,9 +116,9 @@ def register(request):
else:
image = request.FILES.get('image')
print(str(image)+"1111111111111111111111111111111111111111111")
if request.POST.get('sex') == 0:
if request.POST.get('sex') == '1':
sex = ''
else:
elif request.POST.get('sex') == '2':
sex = ''
captcha_input = request.POST.get('captcha_1')
captcha_hashkey = request.POST.get('captcha_0')
@ -136,16 +137,16 @@ def register(request):
filter_result = User.objects.filter(username=username)
if len(filter_result) > 0:
messages.error(request, '对不起,您输入的用户名已被注册')
return render(request, "dashboard/register.html")
messages.error(request, '对不起,您输入的电话号码已被注册')
return HttpResponseRedirect('/register/')
if username is not None and password is not None and confirm_password is not None and email is not None and flag:
user = User.objects.create_user(username, email, password)
user = User.objects.create_user(username,email,password)
user.is_active = True
user.is_staff = True
user.first_name = phone
# user.is_staff = True
# user.first_name = phone
user.save()
userprofile = Userprofile(name=name,image=image,user_id=user.id,organization_id=o,sex=sex)
userprofile = Userprofile(name=name,image=image,user_id=user.id,organization_id=o,sex=sex,status=0)
userprofile.save()
messages.success(request, '注册成功,请登录')
return HttpResponseRedirect('/login/')

View File

@ -0,0 +1,119 @@
{% extends 'dashboard/base/base.html' %}
{% load static %}
{% block content %}
<body class=" ">
<!-- START TOPBAR -->
<!-- START CONTAINER -->
<div class="page-container row-fluid">
<div class="page-sidebar ">
{% include 'dashboard/base/left.html' %}
</div>
<section id="main-content" class=" ">
<section class="wrapper" style='margin-top:60px;display:inline-block;width:100%;padding:15px 0 0 15px;'>
{% if messages %}
<div class="alert alert-success alert-dismissible" role="alert">
<button type="button" class="close" data-dismiss="alert">
<span aria-hidden="true">&times;</span>
<span class="sr-only">Close</span>
</button>
{% for message in messages %}
{{ message }}.<br/>
{% endfor %}
</div>
{% endif %}
<div class='col-lg-12 col-md-12 col-sm-12 col-xs-12'>
<div class="page-title">
<div class="pull-left">
<h1 class="title">系统设置</h1></div>
</div>
</div>
<div class="clearfix"></div>
<div class="col-lg-12 col-md-12 col-xs-12 col-sm-12">
<section class="box ">
<header class="panel_header">
<h2 class="title pull-left">用户信息</h2>
</header>
<div class="content-body">
<div class="row">
<div class="col-md-8 col-sm-9 col-xs-10">
<form method="post"
action="{% url 'user-management-update' usee.id %}"
enctype="multipart/form-data">{% csrf_token %}
<div class="form-group">
<label class="form-label" for="organization">单位</label>
<div class="controls">
<select class="form-control" name="organization">
<option value="{{ userprofile.organization.id }}">{{ userprofile.organization.name }}</option>
{% for o in organization %}
<option value="{{ o.id }}">{{ o.name }}</option>
{% endfor %}
</select>
</div>
</div>
<div class="form-group">
<label class="form-label" for="name">姓名</label>
<div class="controls">
<input type="text" class="form-control" name="name"
value="{{ userprofile.name }}">
</div>
</div>
<div class="form-group">
<label class="form-label" for="email">邮箱</label>
<div class="controls">
<input type="text" class="form-control" name="email"
value="{{ usee.email }}">
</div>
</div>
<div class="form-group">
<label class="form-label" for="username">电话</label>
<div class="controls">
<input type="text" class="form-control" name="username"
value="{{ usee.username }}">
</div>
</div>
<div class="form-group">
<label class="form-label" for="image">图标
<div class="controls">
<input type="file" name="image"><img
src="{{ userprofile.image.url }}"
style="width: 80px;height: 80px;"
class="img-circle">
</div>
</label>
</div>
<div class="form-group">
<label for="passwordold">旧密码<br/>
<input type="password" name="passwordold" id="user_pass" class="input"
value="" size="20"/></label>
</div>
<div class="form-group">
<label for="passwordnew">新密码<br/>
<input type="password" name="passwordnew" id="user_pass" class="input"
value="" size="20"/></label>
</div>
<div class="form-group">
<label for="confirm_password">确认密码<br/>
<input type="password" name="confirm_password" id="user_pass1"
class="input" value=""
size="20"/></label>
</div>
<button type="submit" class="btn btn-primary" style="margin-top: 50px">提交修改
</button>
</form>
</div>
</div>
</div>
</section>
</div>
</section>
</section>
<div class="chatapi-windows "></div>
</div>
</body>
{% endblock %}

View File

@ -1,80 +1,80 @@
{% extends 'dashboard/base/base.html' %}
{% load static %}
{% block css %}
<link href="{% static 'management/css/uikit.min.css' %}" rel="stylesheet" type="text/css" media="screen"/>
<link href="{% static 'management/css/nestable.min.css' %}" rel="stylesheet" type="text/css" media="screen"/>
{% endblock %}
{% block content %}
<body class=" ">
<div class="page-container row-fluid">
<div class="page-sidebar ">
{% include 'dashboard/base/left.html' %}
</div>
<section id="main-content" class=" ">
<section class="wrapper" style='margin-top:60px;display:inline-block;width:100%;padding:15px 0 0 15px;'>
<div class='col-lg-12 col-md-12 col-sm-12 col-xs-12'>
<div class="page-title">
<div class="pull-left">
<h1 class="title">用户管理</h1></div>
</div>
</div>
<div class="clearfix"></div>
<div class="col-lg-12">
<section class="box ">
<header class="panel_header">
<h2 class="title pull-left">成员列表</h2>
</header>
<div class="content-body">
<div class="row">
<div class="col-md-12 col-sm-12 col-xs-12">
<table class="table table-hover">
<thead>
<tr>
<th style="text-align: center">头像</th>
<th style="text-align: center">姓名</th>
<th style="text-align: center">电话</th>
<th style="text-align: center">单位名称</th>
<th style="text-align: center">单位类型</th>
<th style="text-align: center">行政区划</th>
<th style="text-align: center">操作</th>
</tr>
</thead>
<tbody>
{% for u in userallinfo %}
<tr>
<td><img src="{{ u.image }}" style="width: 80px;height: 80px;"
class="img-circle"></td>
<td style="vertical-align: middle;text-align: center">{{ u.name }}</td>
<td style="vertical-align: middle;text-align: center">{{ u.phone }}</td>
<td style="vertical-align: middle;text-align: center">{{ u.organization }}</td>
<td style="vertical-align: middle;text-align: center">{{ u.type }}</td>
<td style="vertical-align: middle;text-align: center">{{ u.administrativedivision }}</td>
<td style="vertical-align: middle;text-align: center">
<a href="{% url 'user-management-delete' u.id %}"
class="btn btn-danger btn-mini">删除</a>
</td>
</tr>
{% endfor %}
</tbody>
</table>
<div class="metadata-pagination">
{% include 'dashboard/paginator/user-management-paginate.html' %}
</div>
</div>
</div>
</div>
</section>
</div>
</section>
</section>
<div class="chatapi-windows ">
</div>
</div>
</body>
{% endblock %}
{% block add_js %}
<script src="{% static 'management/js/uikit.min.js' %}" type="text/javascript"></script>
<script src="{% static 'management/js/nestable.min.js' %}" type="text/javascript"></script>
<script>
</script>
{% endblock %}
{% extends 'dashboard/base/base.html' %}
{% load static %}
{% block css %}
<link href="{% static 'management/css/uikit.min.css' %}" rel="stylesheet" type="text/css" media="screen"/>
<link href="{% static 'management/css/nestable.min.css' %}" rel="stylesheet" type="text/css" media="screen"/>
{% endblock %}
{% block content %}
<body class=" ">
<div class="page-container row-fluid">
<div class="page-sidebar ">
{% include 'dashboard/base/left.html' %}
</div>
<section id="main-content" class=" ">
<section class="wrapper" style='margin-top:60px;display:inline-block;width:100%;padding:15px 0 0 15px;'>
<div class='col-lg-12 col-md-12 col-sm-12 col-xs-12'>
<div class="page-title">
<div class="pull-left">
<h1 class="title">用户管理</h1></div>
</div>
</div>
<div class="clearfix"></div>
<div class="col-lg-12">
<section class="box ">
<header class="panel_header">
<h2 class="title pull-left">成员列表</h2>
</header>
<div class="content-body">
<div class="row">
<div class="col-md-12 col-sm-12 col-xs-12">
<table class="table table-hover">
<thead>
<tr>
<th style="text-align: center">头像</th>
<th style="text-align: center">姓名</th>
<th style="text-align: center">电话</th>
<th style="text-align: center">单位名称</th>
<th style="text-align: center">单位类型</th>
<th style="text-align: center">行政区划</th>
<th style="text-align: center">操作</th>
</tr>
</thead>
<tbody>
{% for u in userallinfo %}
<tr>
<td><img src="{{ u.image.url }}" style="width: 80px;height: 80px;"
class="img-circle"></td>
<td style="vertical-align: middle;text-align: center">{{ u.name }}</td>
<td style="vertical-align: middle;text-align: center">{{ u.phone }}</td>
<td style="vertical-align: middle;text-align: center">{{ u.organization }}</td>
<td style="vertical-align: middle;text-align: center">{{ u.type }}</td>
<td style="vertical-align: middle;text-align: center">{{ u.administrativedivision }}</td>
<td style="vertical-align: middle;text-align: center">
<a href="{% url 'user-management-delete' u.id %}"
class="btn btn-danger btn-mini">删除</a>
</td>
</tr>
{% endfor %}
</tbody>
</table>
<div class="metadata-pagination">
{% include 'dashboard/paginator/user-management-paginate.html' %}
</div>
</div>
</div>
</div>
</section>
</div>
</section>
</section>
<div class="chatapi-windows ">
</div>
</div>
</body>
{% endblock %}
{% block add_js %}
<script src="{% static 'management/js/uikit.min.js' %}" type="text/javascript"></script>
<script src="{% static 'management/js/nestable.min.js' %}" type="text/javascript"></script>
<script>
</script>
{% endblock %}

View File

@ -1,47 +1,48 @@
from django.urls import path
from management import views
urlpatterns = [
# 用户管理
path('user/management/', views.user_management, name='user-management-management'),
path('user/delete/<str:pk>/', views.user_delete, name='user-management-delete'),
# 群组管理
path('group/management/', views.group_management, name='group-management-management'),
path('group/create/', views.group_create, name='group-management-create'),
path('group/update/<str:pk>/', views.group_update, name='group-management-update'),
path('group/delete/<str:pk>/', views.group_delete, name='group-management-delete'),
# 添加群组管理员、成员
path('group/admin/create/<str:pk>/', views.group_admin_create, name='group-admin-create'),
path('group/admin/delete/<str:pk>/<str:group_pk>/', views.group_admin_delete, name='group-admin-delete'),
path('group/user/create/<str:pk>/', views.group_user_create, name='group-user-create'),
path('group/user/delete/<str:pk>/<str:group_pk>/', views.group_user_delete, name='group-user-delete'),
# 主体单位管理
path('organization/management/', views.organization_management, name='organization-management-management'),
path('organization/create/', views.organization_create, name='organization-management-create'),
path('organization/delete/<str:pk>/', views.organization_delete, name='organization-management-delete'),
path('organization/update/<str:pk>/', views.organization_update, name='organization-management-update'),
#新媒体管理
path('newmedia/management/create/menu/',views.newmedia_management_create_menu,name='newmedia-management-create-menu'),
path('newmedia/management/edit/menu/',views.newmedia_management_edit_menu,name='newmedia-management-edit-menu'),
path('newmedia/management/create/weixin/',views.newmedia_management_create_weixin,name='newmedia-management-create-weixin'),
path('newmedia/management/create/weibo/',views.newmedia_management_create_weibo,name='newmedia-management-create-weibo'),
path('newmedia/management/create/toutiao/',views.newmedia_management_create_toutiao,name='newmedia-management-create-toutiao'),
path('newmedia/management/create/qita/',views.newmedia_management_create_qita,name='newmedia-management-create-qita'),
path('newmedia/management/edit/weixin/',views.newmedia_management_edit_weixin,name='newmedia-management-edit-weixin'),
path('newmedia/management/edit/weibo/',views.newmedia_management_edit_weibo,name='newmedia-management-edit-weibo'),
path('newmedia/management/edit/toutiao/',views.newmedia_management_edit_toutiao,name='newmedia-management-edit-toutiao'),
path('newmedia/management/edit/qita/',views.newmedia_management_edit_qita,name='newmedia-management-edit-qita'),
path('newmedia/management/update/weixin/<str:pk>/',views.newmedia_management_update_weixin,name='newmedia-management-update-weixin'),
path('newmedia/management/update/weibo/<str:pk>/',views.newmedia_management_update_weibo,name='newmedia-management-update-weibo'),
path('newmedia/management/update/toutiao/<str:pk>/',views.newmedia_management_update_toutiao,name='newmedia-management-update-toutiao'),
path('newmedia/management/update/qita/<str:pk>/',views.newmedia_management_update_qita,name='newmedia-management-update-qita'),
path('newmedia/management/delete/weixin/<str:pk>/',views.newmedia_management_delete_weixin,name='newmedia-management-delete-weixin'),
path('newmedia/management/delete/weibo/<str:pk>/',views.newmedia_management_delete_weibo,name='newmedia-management-delete-weibo'),
path('newmedia/management/delete/toutiao/<str:pk>/',views.newmedia_management_delete_toutiao,name='newmedia-management-delete-toutiao'),
path('newmedia/management/delete/qita/<str:pk>/',views.newmedia_management_delete_qita,name='newmedia-management-delete-qita'),
]
from django.urls import path
from management import views
urlpatterns = [
# 用户管理
path('user/management/', views.user_management, name='user-management-management'),
path('user/delete/<str:pk>/', views.user_delete, name='user-management-delete'),
path('user/update/<str:pk>/', views.user_update, name='user-management-update'),
# 群组管理
path('group/management/', views.group_management, name='group-management-management'),
path('group/create/', views.group_create, name='group-management-create'),
path('group/update/<str:pk>/', views.group_update, name='group-management-update'),
path('group/delete/<str:pk>/', views.group_delete, name='group-management-delete'),
# 添加群组管理员、成员
path('group/admin/create/<str:pk>/', views.group_admin_create, name='group-admin-create'),
path('group/admin/delete/<str:pk>/<str:group_pk>/', views.group_admin_delete, name='group-admin-delete'),
path('group/user/create/<str:pk>/', views.group_user_create, name='group-user-create'),
path('group/user/delete/<str:pk>/<str:group_pk>/', views.group_user_delete, name='group-user-delete'),
# 主体单位管理
path('organization/management/', views.organization_management, name='organization-management-management'),
path('organization/create/', views.organization_create, name='organization-management-create'),
path('organization/delete/<str:pk>/', views.organization_delete, name='organization-management-delete'),
path('organization/update/<str:pk>/', views.organization_update, name='organization-management-update'),
#新媒体管理
path('newmedia/management/create/menu/',views.newmedia_management_create_menu,name='newmedia-management-create-menu'),
path('newmedia/management/edit/menu/',views.newmedia_management_edit_menu,name='newmedia-management-edit-menu'),
path('newmedia/management/create/weixin/',views.newmedia_management_create_weixin,name='newmedia-management-create-weixin'),
path('newmedia/management/create/weibo/',views.newmedia_management_create_weibo,name='newmedia-management-create-weibo'),
path('newmedia/management/create/toutiao/',views.newmedia_management_create_toutiao,name='newmedia-management-create-toutiao'),
path('newmedia/management/create/qita/',views.newmedia_management_create_qita,name='newmedia-management-create-qita'),
path('newmedia/management/edit/weixin/',views.newmedia_management_edit_weixin,name='newmedia-management-edit-weixin'),
path('newmedia/management/edit/weibo/',views.newmedia_management_edit_weibo,name='newmedia-management-edit-weibo'),
path('newmedia/management/edit/toutiao/',views.newmedia_management_edit_toutiao,name='newmedia-management-edit-toutiao'),
path('newmedia/management/edit/qita/',views.newmedia_management_edit_qita,name='newmedia-management-edit-qita'),
path('newmedia/management/update/weixin/<str:pk>/',views.newmedia_management_update_weixin,name='newmedia-management-update-weixin'),
path('newmedia/management/update/weibo/<str:pk>/',views.newmedia_management_update_weibo,name='newmedia-management-update-weibo'),
path('newmedia/management/update/toutiao/<str:pk>/',views.newmedia_management_update_toutiao,name='newmedia-management-update-toutiao'),
path('newmedia/management/update/qita/<str:pk>/',views.newmedia_management_update_qita,name='newmedia-management-update-qita'),
path('newmedia/management/delete/weixin/<str:pk>/',views.newmedia_management_delete_weixin,name='newmedia-management-delete-weixin'),
path('newmedia/management/delete/weibo/<str:pk>/',views.newmedia_management_delete_weibo,name='newmedia-management-delete-weibo'),
path('newmedia/management/delete/toutiao/<str:pk>/',views.newmedia_management_delete_toutiao,name='newmedia-management-delete-toutiao'),
path('newmedia/management/delete/qita/<str:pk>/',views.newmedia_management_delete_qita,name='newmedia-management-delete-qita'),
]

File diff suppressed because it is too large Load Diff

View File

Before

Width:  |  Height:  |  Size: 38 KiB

After

Width:  |  Height:  |  Size: 38 KiB

View File

Before

Width:  |  Height:  |  Size: 38 KiB

After

Width:  |  Height:  |  Size: 38 KiB

View File

Before

Width:  |  Height:  |  Size: 38 KiB

After

Width:  |  Height:  |  Size: 38 KiB

View File

Before

Width:  |  Height:  |  Size: 7.5 KiB

After

Width:  |  Height:  |  Size: 7.5 KiB

View File

Before

Width:  |  Height:  |  Size: 7.4 KiB

After

Width:  |  Height:  |  Size: 7.4 KiB

View File

Before

Width:  |  Height:  |  Size: 7.4 KiB

After

Width:  |  Height:  |  Size: 7.4 KiB

View File

Before

Width:  |  Height:  |  Size: 7.4 KiB

After

Width:  |  Height:  |  Size: 7.4 KiB

View File

Before

Width:  |  Height:  |  Size: 23 KiB

After

Width:  |  Height:  |  Size: 23 KiB

View File

Before

Width:  |  Height:  |  Size: 23 KiB

After

Width:  |  Height:  |  Size: 23 KiB

View File

Before

Width:  |  Height:  |  Size: 38 KiB

After

Width:  |  Height:  |  Size: 38 KiB

View File

Before

Width:  |  Height:  |  Size: 23 KiB

After

Width:  |  Height:  |  Size: 23 KiB

View File

Before

Width:  |  Height:  |  Size: 38 KiB

After

Width:  |  Height:  |  Size: 38 KiB

View File

Before

Width:  |  Height:  |  Size: 23 KiB

After

Width:  |  Height:  |  Size: 23 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 23 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 23 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 23 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 23 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 23 KiB

View File

Before

Width:  |  Height:  |  Size: 12 KiB

After

Width:  |  Height:  |  Size: 12 KiB

View File

Before

Width:  |  Height:  |  Size: 8.7 KiB

After

Width:  |  Height:  |  Size: 8.7 KiB

View File

Before

Width:  |  Height:  |  Size: 7.5 KiB

After

Width:  |  Height:  |  Size: 7.5 KiB

View File

Before

Width:  |  Height:  |  Size: 7.4 KiB

After

Width:  |  Height:  |  Size: 7.4 KiB

2
passenger_wsgi.py Normal file
View File

@ -0,0 +1,2 @@
import NewMediaMonitoring.wsgi
application = NewMediaMonitoring.wsgi.application

View File

@ -21,7 +21,7 @@ class VerifyCode(models.Model):
def is_in_progress(self):
now = datetime.datetime.now()
return snow <= self.timeouted
return now <= self.timeouted
def __str__(self):

View File

@ -1,122 +1,125 @@
from django.shortcuts import render
from django.http import HttpResponse, JsonResponse
from django.contrib.auth import get_user_model
from django.views.decorators.csrf import csrf_exempt
from django_token.models import Token
def index(request):
username = request.GET.get('username')
password = request.GET.get('password')
print(username, password)
return JsonResponse({'status': 'error', 'message': '用户名或密码错误'})
def status_500(request):
return HttpResponse(status=500)
def status_401(request):
return HttpResponse(status=401)
@csrf_exempt
def polls_login(request):
if request.method == 'POST':
phone = request.POST.get('phone')
password = request.POST.get('password')
UserModel = get_user_model()
user = UserModel.objects.filter(first_name=phone).first()
if not user:
return JsonResponse({'status': 'error', 'message': '用户名或密码错误'})
u = authenticate(request, username=user.username, password=password)
if u is not None:
login(request, u)
token = Token.objects.get_or_create(user=u)
result = dict()
profile = u.userprofile_set.first()
result['phone'] = u.first_name
result['token'] = token
if profile:
result['name'] = profile.name
result['gender'] = profile.sex
result['thumbnail'] = profile.image.path
result['organization'] = profile.organization.name
return JsonResponse({'status': 'success', 'message': result})
else:
return JsonResponse({'status': 'error', 'message': '用户名或密码错误'})
else:
return HttpResponse(status=405)
@csrf_exempt
def send_code(request):
if request.method == 'GET':
return HttpResponse(status=405)
phone = request.POST.get('phone')
category = request.POST.get('category', 0)
if not phone:
return JsonResponse({'status': 'error', 'message': '手机号不正确'})
exist_code = VerifyCode.objects.filter(phone=phone, category=category).first()
if exist_code and exist_code.in_progress():
return JsonResponse({'status': 'error', 'message': '验证码使用中'})
code = generate_code()
now = datetime.datetime.now()
after_10mins = now + datetime.timedelta(minutes=10)
response = send_sms_code(phone, code)
result = response.decode('utf8')
if "OK" in result:
VerifyCode.objects.create(code=code, phone=phone, category=category)
return JsonResponse({'status': 'success'})
return JsonResponse({'status': 'error', 'message': '验证码发送失败'})
@csrf_exempt
def register_step_one(request):
if request.method == 'GET':
return HttpResponse(status=405)
phone = request.POST.get('phone')
code = request.POST.get('code')
exist_code = VerifyCode.objects.filter(phone=phone, code=code, category=0).exist()
if exist_code.in_progress():
return JsonResponse({'status': 'success', 'message': {phone: phone}})
else:
return JsonResponse({'status': 'error', 'message': '验证码超时,请重发'})
@csrf_exempt
def register_step_two(request):
if request.method == 'GET':
return HttpResponse(status=405)
phone = request.POST.get('phone')
name = request.POST.get('name')
gender = request.POST.get('gender')
organization = request.POST.get('organization')
# create user
return JsonResponse({'status': 'success', 'message': '注册成功'})
@csrf_exempt
def password_recover_step_one(request):
if request.method == 'GET':
return HttpResponse(status=405)
phone = request.POST.get('phone')
code = request.POST.get('code')
exist_code = VerifyCode.objects.filter(phone=phone, code=code, category=1).exist()
if exist_code.in_progress():
return JsonResponse({'status': 'success', 'message': {phone: phone}})
else:
return JsonResponse({'status': 'error', 'message': '验证码超时,请重发'})
@csrf_exempt
def password_recover_step_two(request):
if request.method == 'GET':
return HttpResponse(status=405)
phone = request.POST.get('phone')
password = request.POST.get('password')
password_confirm = request.POST.get('password_confirm')
from django.shortcuts import render
from django.http import HttpResponse, JsonResponse
from django.contrib.auth import get_user_model, authenticate, login
from django.views.decorators.csrf import csrf_exempt
from django_token.models import Token
import datetime
from .models import VerifyCode
from .utils import generate_code, send_sms_code
def index(request):
username = request.GET.get('username')
password = request.GET.get('password')
print(username, password)
return JsonResponse({'status': 'error', 'message': '用户名或密码错误'})
def status_500(request):
return HttpResponse(status=500)
def status_401(request):
return HttpResponse(status=401)
@csrf_exempt
def polls_login(request):
if request.method == 'POST':
phone = request.POST.get('phone')
password = request.POST.get('password')
UserModel = get_user_model()
user = UserModel.objects.filter(first_name=phone).first()
if not user:
return JsonResponse({'status': 'error', 'message': '用户名或密码错误'})
u = authenticate(request, username=user.username, password=password)
if u is not None:
login(request, u)
token = Token.objects.get_or_create(user=u)
result = dict()
profile = u.userprofile_set.first()
result['phone'] = u.first_name
result['token'] = token
if profile:
result['name'] = profile.name
result['gender'] = profile.sex
result['thumbnail'] = profile.image.path
result['organization'] = profile.organization.name
return JsonResponse({'status': 'success', 'message': result})
else:
return JsonResponse({'status': 'error', 'message': '用户名或密码错误'})
else:
return HttpResponse(status=405)
@csrf_exempt
def send_code(request):
if request.method == 'GET':
return HttpResponse(status=405)
phone = request.POST.get('phone')
category = request.POST.get('category', 0)
if not phone:
return JsonResponse({'status': 'error', 'message': '手机号不正确'})
exist_code = VerifyCode.objects.filter(phone=phone, category=category).first()
if exist_code and exist_code.in_progress():
return JsonResponse({'status': 'error', 'message': '验证码使用中'})
code = generate_code()
now = datetime.datetime.now()
after_10mins = now + datetime.timedelta(minutes=10)
response = send_sms_code(phone, code)
result = response.decode('utf8')
if "OK" in result:
VerifyCode.objects.create(code=code, phone=phone, category=category)
return JsonResponse({'status': 'success'})
return JsonResponse({'status': 'error', 'message': '验证码发送失败'})
@csrf_exempt
def register_step_one(request):
if request.method == 'GET':
return HttpResponse(status=405)
phone = request.POST.get('phone')
code = request.POST.get('code')
exist_code = VerifyCode.objects.filter(phone=phone, code=code, category=0).exist()
if exist_code.in_progress():
return JsonResponse({'status': 'success', 'message': {phone: phone}})
else:
return JsonResponse({'status': 'error', 'message': '验证码超时,请重发'})
@csrf_exempt
def register_step_two(request):
if request.method == 'GET':
return HttpResponse(status=405)
phone = request.POST.get('phone')
name = request.POST.get('name')
gender = request.POST.get('gender')
organization = request.POST.get('organization')
# create user
return JsonResponse({'status': 'success', 'message': '注册成功'})
@csrf_exempt
def password_recover_step_one(request):
if request.method == 'GET':
return HttpResponse(status=405)
phone = request.POST.get('phone')
code = request.POST.get('code')
exist_code = VerifyCode.objects.filter(phone=phone, code=code, category=1).exist()
if exist_code.in_progress():
return JsonResponse({'status': 'success', 'message': {phone: phone}})
else:
return JsonResponse({'status': 'error', 'message': '验证码超时,请重发'})
@csrf_exempt
def password_recover_step_two(request):
if request.method == 'GET':
return HttpResponse(status=405)
phone = request.POST.get('phone')
password = request.POST.get('password')
password_confirm = request.POST.get('password_confirm')

View File

@ -1,7 +1,7 @@
Django~=2.2.15
django-bootstrap3
django-simple-captcha
psycopg2-binary
django-cors-headers
aliyun-python-sdk-core-v3
Django~=2.2.15
django-bootstrap3
django-simple-captcha
psycopg2-binary
django-cors-headers
aliyun-python-sdk-core-v3

File diff suppressed because it is too large Load Diff

Binary file not shown.

After

Width:  |  Height:  |  Size: 38 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 38 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 38 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 23 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 23 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 38 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 23 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 38 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 23 KiB

BIN
static/media/qita.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

BIN
static/media/toutiao.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.7 KiB

BIN
static/media/weibo.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.5 KiB

BIN
static/media/weixin.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.4 KiB