commit 55d126b2205142c6344529792f3972a654357786 Author: YunMao Date: Thu Apr 2 22:53:01 2020 +0800 整合版本 diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..fec6b87 --- /dev/null +++ b/.gitignore @@ -0,0 +1,7 @@ +__pycache__ +migrations/ +.idea +.vscode +*.pyc +db.sqlite3 +config.ini \ No newline at end of file diff --git a/README.md b/README.md new file mode 100644 index 0000000..8cff9a4 --- /dev/null +++ b/README.md @@ -0,0 +1,116 @@ +# 微光综合系统 + +## 简介 + +本系统是微光支教定制开发的综合系统,其中包含报名、面试、家访、综合信息等等,将一步步实现。 + +## 用户身份 + +- 面试官 +- 老队员 +- 工作人员 +- 报名人员 +- 管理员 + +## 用户关系说明 + +1. 面试官由老队员自愿报名和工作人员组成; +2. 老队员指之前参与过微光支教的人员; +3. 报名人员为在校大学生,可以为老队员、工作人员; +4. 管理员为IT部门和部分工作人员; +5. 工作人员分为:理事会、IT部门、财务部、规培部-队长方向、规培部-教学方向、女童保护、水计划-教学方向、水计划-调研方向、宣传部、综合管理部-行政方向、综合管理部-人事方向、综合管理部-外事方向-高校社团合作、综合管理部门-外事方向-家访、财务部。 + +## 用户基本属性(详见数据库) + +- 注册用户:唯一编号、姓名、邮箱、密码 +- 完善信息:唯一编号、性别、手机号、所在院校 +- 工作人员:唯一编号、所在部门、出生日期、学校(单位)专业年级、备注 +- 报名人员:唯一编号、备注 +- 面试官:继承工作人员和老队员信息 +- 管理员:继承工作人员信息 +- 老队员:继承报名人员信息 + +## 系统事件 + +### 报名系统(笔试)(已确认) + +#### 报名人员 + +- 报名微光(和易考联接); +- 查询准考证号,进入链接考试 +- 提醒做题; +- 查询笔试是否录取的结果。 + +#### 管理员 + +- 新建报名项目(第几期); +- 导出名单并导入易考系统; +- 导入从易考系统导出的准考证号信息; +- 分配批试卷安排(可设置试卷由多位面试官批改); +- 最后导入易考的最终成绩,生成最后的成绩; +- 手动设置报名人员是否通过笔试。 + +#### 面试官 + +- 根据分配的试卷进行批改(链接跳转); + +### 群面(已确认) + +#### 报名人员(群面) + +- 通过笔试的报名人员方可参与群面; +- 登录系统对面试场次进行预约; +- 申请修改面试场次(不可自行修改,并记录申请次数); +- 查看面试结果 + +#### 管理员(群面) + +- 设置群面时间(包含类型(线上、线下)、起止时间、当日结束预约时间) +- 审核修改面试时间申请 +- 直接修改面试时间 +- 修改面试官面试场次 +- 录入面试结果 + +#### 面试官(群面) + +- 选择面试场次 +- 修改面试场次 +- 提交面试信息 + +## 数据结构 + +### 报名数据库结构 + +| 名称(中文) | 说明 | +|--------|------------------| +| 编号 | 报名人员拥有唯一编号 | +| 项目编号 | 项目拥有唯一编号 | +| 准考证号 | 易考导入的准考证号 | +| 是否答题 | 1为已答题,0为未答题 | +| 是否录取 | 0为待定,1为已录取,2为未录取 | + +### 数据库 + +- 注册用户:* 唯一编号、姓名、邮箱、密码(已实现) +- 完善信息:* 唯一编号、性别、手机号、所在院校(已实现) +- 工作人员:* 唯一编号、所在部门、出生日期、学校(单位)专业年级、备注 +- 面试官:* 唯一编号、备注 +- 管理员:* 唯一编号、备注 +- 老队员:* 唯一编号、所在期数、备注 + +- 笔试项目:* 项目编号、项目名称、易考链接 +- 报名笔试:* 唯一编号、* 项目编号、准考证号、答题情况、录取情况 + +## 用例事件 + +1. 支教人员登入我们系统报名,提供姓名、手机号等必须信息; +2. 我们管理员将这些信息从我们系统导出,然后导入易考的考试; +3. 易考产生的准考证号等信息导入到我们的系统; +4. 报名者随时登入系统(或我们自行规定什么时间是导入时间),看一看准考证号是否有,然后进入易考考试; +5. 每天(比如晚上9点)我们从易考导出考试信息,导入我们系统,自动分配给面试官已做完的人员信息,面试官根据链接进入易考进行批改。 + +## 部署 + +设置中:```SECRET_KEY```、 ```ALLOWED_HOSTS```、 ```EMAIL_HOST_USER```、 ```EMAIL_HOST_PASSWORD``` + +数据库: ```python manage.py makemigrations wgsite```、```python manage.py migrate wgsite``` diff --git a/Weiguang/__init__.py b/Weiguang/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/Weiguang/settings.py b/Weiguang/settings.py new file mode 100644 index 0000000..af7c227 --- /dev/null +++ b/Weiguang/settings.py @@ -0,0 +1,156 @@ +""" +Django settings for Weiguang project. + +Generated by 'django-admin startproject' using Django 2.2. + +For more information on this file, see +https://docs.djangoproject.com/en/2.2/topics/settings/ + +For the full list of settings and their values, see +https://docs.djangoproject.com/en/2.2/ref/settings/ +""" + +import os +from configparser import ConfigParser + + + +# Build paths inside the project like this: os.path.join(BASE_DIR, ...) +BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) + +# 传入读取文件的地址,encoding文件编码格式,中文必须UTF-8 +config = ConfigParser() +config.read('config.ini', encoding='UTF-8') + +# Quick-start development settings - unsuitable for production +# See https://docs.djangoproject.com/en/2.2/howto/deployment/checklist/ + +# SECURITY WARNING: keep the secret key used in production secret! +SECRET_KEY = config['system']['SECRET_KEY'] + +# 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', + 'wgsite', +] + +MIDDLEWARE = [ + 'django.middleware.security.SecurityMiddleware', + 'django.contrib.sessions.middleware.SessionMiddleware', + 'django.middleware.common.CommonMiddleware', + 'django.middleware.csrf.CsrfViewMiddleware', + 'django.contrib.auth.middleware.AuthenticationMiddleware', + 'django.contrib.messages.middleware.MessageMiddleware', + 'django.middleware.clickjacking.XFrameOptionsMiddleware', +] + +ROOT_URLCONF = 'Weiguang.urls' + +TEMPLATES = [ + { + 'BACKEND': 'django.template.backends.django.DjangoTemplates', + 'DIRS': [BASE_DIR+'/Weiguang/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 = 'Weiguang.wsgi.application' + + +# Database +# https://docs.djangoproject.com/en/2.2/ref/settings/#databases + +DATABASES = { + 'default': { + 'ENGINE': 'django.db.backends.sqlite3', + 'NAME': os.path.join(BASE_DIR, 'db.sqlite3'), + } +} +# DATABASES = { +# 'default': { +# 'ENGINE': 'django.db.backends.mysql', +# 'NAME': '', +# 'USER': '', +# 'PASSWORD': '', +# 'HOST': '', +# 'PORT': '', +# 'OPTIONS': { +# "init_command": "SET default_storage_engine=INNODB,FOREIGN_KEY_CHECKS=0", +# } +# } +# } + +# Password validation +# https://docs.djangoproject.com/en/2.2/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', + }, +] + + +# Internationalization +# https://docs.djangoproject.com/en/2.2/topics/i18n/ + +LANGUAGE_CODE = 'zh-hans' + +TIME_ZONE = 'Asia/Shanghai' + +USE_I18N = True + +USE_L10N = True + +USE_TZ = True + + +# Static files (CSS, JavaScript, Images) +# https://docs.djangoproject.com/en/2.2/howto/static-files/ +STATIC_URL = '/static/' +STATICFILES_DIRS = ( + BASE_DIR+'/static/', +) + +# 邮件配置信息 +EMAIL_USE_SSL = True +# 邮件服务器,如果是 163 改成 smtp.163.com +EMAIL_HOST = 'smtp.qq.com' +# 邮件服务器端口 +EMAIL_PORT = 465 +# 发送邮件的账号 +EMAIL_HOST_USER = config['system']['EMAIL_HOST_USER'] +# SMTP服务密码 +EMAIL_HOST_PASSWORD = config['system']['EMAIL_HOST_PASSWORD'] +DEFAULT_FROM_EMAIL = EMAIL_HOST_USER + +MEDIA_ROOT = os.path.join(BASE_DIR, 'upload/') +MEDIA_URL = '/upload/' \ No newline at end of file diff --git a/Weiguang/templates/404.html b/Weiguang/templates/404.html new file mode 100644 index 0000000..3a36373 --- /dev/null +++ b/Weiguang/templates/404.html @@ -0,0 +1,400 @@ + + + + + + + + + + + + SB Admin 2 - 404 + + + + + + + + + + + + + +
+ + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + diff --git a/Weiguang/templates/abmbsproject.html b/Weiguang/templates/abmbsproject.html new file mode 100644 index 0000000..46633c3 --- /dev/null +++ b/Weiguang/templates/abmbsproject.html @@ -0,0 +1,79 @@ +{% extends "base.html" %} + + +{% block title %}任务列表{% endblock %} + +{% block staticcss %} + + +{% endblock %} + +{% block staticjs %} + +{% endblock %} + +{% block content %} +
+ + + + +
+
+

笔试项目

+
+
+ +
+
+ +
+
+

+
+
+ {% csrf_token %} + + {{ form.as_p }} + +
+ +
+ +
+
+
+ +{% endblock %} \ No newline at end of file diff --git a/Weiguang/templates/base.html b/Weiguang/templates/base.html new file mode 100644 index 0000000..f7b77dc --- /dev/null +++ b/Weiguang/templates/base.html @@ -0,0 +1,244 @@ + + + + + + + + + + + + SB Admin 2 - Dashboard + + + + + + + + + + + + + + + +
+ + + + + + + +
+ + +
+ + + + + + +
+ {% block content %}{% endblock %} +
+ + +
+ + + +
+
+ +
+
+ + +
+ + +
+ + + + + + + + + + + + + + + + + + + + + + + + + {% block staticjs %} + + {% endblock %} + + + + + \ No newline at end of file diff --git a/Weiguang/templates/baseform.html b/Weiguang/templates/baseform.html new file mode 100644 index 0000000..68ea5b2 --- /dev/null +++ b/Weiguang/templates/baseform.html @@ -0,0 +1,84 @@ +{% extends "base.html" %} +{% load staticfiles %} + +{% block staticcss %} + +{% endblock %} + +{% block staticjs %} + +{% endblock %} + +{% block content %} + + + +
+
+
+

新任务

+
+
+ +
+
+
操作面板
+
+
+

操作面板文案

+
+ {% csrf_token %} + {% for hidden in form.hidden_fields %} + {{ hidden }} + {% endfor %} + + {% for field in form.visible_fields %} +
+
+ {{field.label}} +
+ {{field}} +
+ {% endfor %} + + {% if messages %} + {% for message in messages %} + + {% endfor %} + {% endif %} + {% if messages %} + {% for message in messages %} + + {% endfor %} + {% endif %} + + +
+ +
+
+ + + + {% if form.errors %} + + {% for field, error in form.errors.items %} +
+ {{ field }} {{ error }} +
+ {% endfor %} + + + {% endif %} + + + +
+ + + +{% endblock %} \ No newline at end of file diff --git a/Weiguang/templates/bmbsproject.html b/Weiguang/templates/bmbsproject.html new file mode 100644 index 0000000..6f2149f --- /dev/null +++ b/Weiguang/templates/bmbsproject.html @@ -0,0 +1,243 @@ +{% extends "base.html" %} + + +{% block title %}任务列表{% endblock %} + +{% block staticcss %} + + +{% endblock %} + +{% block staticjs %} + +{% endblock %} + +{% block content %} + + + +
+ + + + +
+
+

笔试项目

+
+
+ {% if messages %} + + {% endif %} +
+
+
已报名
+ +
+ +
+ + {% if form.errors %} + + {% for field, error in form.errors.items %} +
+ {{ field }} {{ error }} +
+ {% endfor %} + + + {% endif %} +
+ + + + + + + + + + + + + + + + + + + + {% for list in bmbsproject %} + + + + + + + {% endfor %} + + +
笔试项目考试地址准考证号是否通过
笔试项目考试地址准考证号是否通过
{{ list.bsproject.name}}{{ list.bsproject.link}}{{ list.zkzh }}{{ list.get_lqqk_display }}
+
+
+
+
+
+
项目列表
+ +
+ +
+ + {% if form.errors %} + + {% for field, error in form.errors.items %} +
+ {{ field }} {{ error }} +
+ {% endfor %} + + + {% endif %} +
+ + + + + + + + + + + + + + + + + + + + + + {% for list in bsproject %} + + + {% csrf_token %} + + + + + + + + {% endfor %} + + +
ID笔试项目考试地址是否可以报名操作
ID笔试项目考试地址是否可以报名操作
{{ forloop.counter }}{{ list.name}}{{ list.link }}{{ list.able }} + +
+
+
+
+ +
+ + +{% if form.errors %} + +{% for field, error in form.errors.items %} +
+ {{ field }} {{ error }} +
+{% endfor %} + + +{% endif %} + + + + + +{% endblock %} \ No newline at end of file diff --git a/Weiguang/templates/bsproject.html b/Weiguang/templates/bsproject.html new file mode 100644 index 0000000..5459d6a --- /dev/null +++ b/Weiguang/templates/bsproject.html @@ -0,0 +1,220 @@ +{% extends "base.html" %} + + +{% block title %}任务列表{% endblock %} + +{% block staticcss %} + + +{% endblock %} + +{% block staticjs %} + +{% endblock %} + +{% block content %} + + + +
+ + + + +
+
+

笔试项目

+
+
+ {% if messages %} + + {% endif %} +
+
+
项目列表
+ +
+ +
+ + {% if form.errors %} + + {% for field, error in form.errors.items %} +
+ {{ field }} {{ error }} +
+ {% endfor %} + + + {% endif %} +
+ + + + + + + + + + + + + + + + + + + + + + + + {% for list in bsproject %} + + + + + + + + + + {% endfor %} + + +
选择ID笔试项目考试地址是否可以报名操作
选择ID笔试项目考试地址是否可以报名操作
{{ forloop.counter }} + {{ list.name}}{{ list.link }}{{ list.able }} +
+ {% csrf_token %} + +
+ 编辑 + 删除 +
+ +
+
+
+ +
+ + +{% if form.errors %} + +{% for field, error in form.errors.items %} +
+ {{ field }} {{ error }} +
+{% endfor %} + + +{% endif %} + + + +
+ {% csrf_token %} + +
+ +{% endblock %} \ No newline at end of file diff --git a/Weiguang/templates/forgot-password.html b/Weiguang/templates/forgot-password.html new file mode 100644 index 0000000..e0d0a61 --- /dev/null +++ b/Weiguang/templates/forgot-password.html @@ -0,0 +1,103 @@ + + + + + + + + + + + + SB Admin 2 - Forgot Password + + + + + + + + + + + + +
+ + +
+ +
+ +
+
+ +
+
+
+
+
+

Forgot Your Password?

+

We get it, stuff happens. Just enter your email address below and we'll send you a + link to reset your password!

+
+
+ {% csrf_token %} +
+ +
+
+ +
+ {% if new_password %} +
+ +
+ {% endif %} + {% if messages %} + {% for message in messages %} + + {% endfor %} + {% endif %} + +
+ +
+ + +
+
+
+
+
+ +
+ +
+ +
+ + + + + + + + + + + + + + \ No newline at end of file diff --git a/Weiguang/templates/index.html b/Weiguang/templates/index.html new file mode 100644 index 0000000..cc03f4b --- /dev/null +++ b/Weiguang/templates/index.html @@ -0,0 +1,8 @@ +{% extends "base.html" %} +{% block sidebar %} + +{% endblock %} +{% block content %} +“微光支教”成立于2014年5月,专注于短期支教。微光支教面向全国各大高校招募有爱心,有奉献精神,能够吃苦,能够自律,善于合作,品学兼优的优秀大学生作为志愿者。旨在通过微光行动,将“希望”这一理念带给孩子们,并影响支教地村民。微光支教希望通过每一个微光光源,将希望之光在大山里传递。微光希望通过一次次真正意义上的教育活动,帮助当地学生拓展视野、巩固学业、培养兴趣,树立积极向上的学习态度和人生观,让他们敢于用自己的双手去改变大山深处的贫困,为山区教育环境的改善献出我们的一份力量。 +在新规划中,微光将以短期支教为载体,拓宽服务项目,开展医疗援助,农业帮扶等活动,并且对接特困学生家庭与社会爱心人士。在最大范围内,整合国内高校的支教队伍,形成一个志愿者统一注册选拔培训的大型支教平台。 +{% endblock %} \ No newline at end of file diff --git a/Weiguang/templates/lbmbsproject.html b/Weiguang/templates/lbmbsproject.html new file mode 100644 index 0000000..354fb2d --- /dev/null +++ b/Weiguang/templates/lbmbsproject.html @@ -0,0 +1,79 @@ +{% extends "base.html" %} + + +{% block title %}任务列表{% endblock %} + +{% block staticcss %} + + +{% endblock %} + +{% block staticjs %} + +{% endblock %} + +{% block content %} +
+ + + + +
+
+

笔试项目

+
+
+ +
+
+ +
+
+

+
+
+ {% csrf_token %} + + {{ form.as_p }} + +
+ +
+ +
+
+
+ +{% endblock %} \ No newline at end of file diff --git a/Weiguang/templates/login.html b/Weiguang/templates/login.html new file mode 100644 index 0000000..7e6be0d --- /dev/null +++ b/Weiguang/templates/login.html @@ -0,0 +1,91 @@ + + + + + + + + + + + + 微光支教-登录 + + + + + + + + + + + + +
+ + +
+ +
+ +
+
+ +
+ +
+
+
+

微光欢迎您

+
+
+ {% csrf_token %} + {% for field in login_form %} +
+ {{field}} +
+ {% endfor %} + + +
+
+ {% if messages %} + {% for message in messages %} + + {% endfor %} + {% endif %} + + +
+
+
+
+
+ +
+ +
+ +
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/Weiguang/templates/manage_people.html b/Weiguang/templates/manage_people.html new file mode 100644 index 0000000..7c58de4 --- /dev/null +++ b/Weiguang/templates/manage_people.html @@ -0,0 +1,248 @@ +{% extends "base.html" %} +{% block staticjs %} + + + +{% endblock %} +{% block content %} + +

人员管理

+ +
+ +
+ + + +
+
+
管理员设置
+
+
+

管理员文案

+
+ {% csrf_token %} + {% for field in information_add %} +
+
+ {{field.label}} +
+ {{field}} +
+ {% endfor %} + {% if messages %} + {% for message in messages %} + + {% endfor %} + {% endif %} + +
+ +
+
+
+
+
工作人员设置
+
+
+

工作人员设置文案

+
+ {% csrf_token %} + {% for field in staffuser_add %} +
+
+ {{field.label}} +
+ {{ field.errors }} + {{field}} +
+ {% endfor %} + {% if messages %} + {% for message in messages %} + + {% endfor %} + + {% endif %} + + +
+ +
+
+
+ +
+
+
+
管理员
+
+
+
+ + + + + + + + + + + + + + + + + + + {% for list in information_now %} + + + + + + + {% endfor %} + + +
选择ID姓名操作
选择ID姓名操作
{{ forloop.counter }} + {{ list.staffuser__myuser__realname}} + 编辑 + 删除 + +
+
+
+
+
+
+
工作人员
+
+
+
+ + + + + + + + + + + + + + + + + + + + + {% for list in staffuser_now %} + + + + + + + + {% endfor %} + + +
选择ID部门姓名操作
选择ID部门姓名操作
{{ forloop.counter }} + {{ list.department}}{{ list.myuser__realname}} + 编辑 + 删除 + +
+
+
+
+ +
+ +
+ + +{% endblock %} \ No newline at end of file diff --git a/Weiguang/templates/register.html b/Weiguang/templates/register.html new file mode 100644 index 0000000..557e2e2 --- /dev/null +++ b/Weiguang/templates/register.html @@ -0,0 +1,97 @@ + + + + + + + + + + + + 微光支教-注册 + + + + + + + + + + + + +
+
+
+
+
+ +
+
+
+
+
+

欢迎注册微光!

+
+
+ {% csrf_token %} +
+
+ {{register_form.username}} +
+
+
+ {{register_form.email}} +
+
+
+ {{register_form.password}} +
+
+ {{register_form.repassword}} +
+
+ +
+
+
+ {% if messages %} + {% for message in messages %} + + {% endfor %} + {% endif %} + + + +
+
+
+
+
+
+
+
+ + + + + + + + + + + + + + \ No newline at end of file diff --git a/Weiguang/templates/showbm.html b/Weiguang/templates/showbm.html new file mode 100644 index 0000000..badb2f3 --- /dev/null +++ b/Weiguang/templates/showbm.html @@ -0,0 +1,194 @@ +{% extends "base.html" %} + + +{% block title %}任务列表{% endblock %} + +{% block staticcss %} + + +{% endblock %} + +{% block staticjs %} + +{% endblock %} + +{% block content %} + + + +
+ + + + +
+
+

笔试项目

+
+
+ {% if messages %} + + {% endif %} +
+
+
报名人员列表
+ +
+ +
+ + {% if form.errors %} + + {% for field, error in form.errors.items %} +
+ {{ field }} {{ error }} +
+ {% endfor %} + + + {% endif %} +
+ + + + + + + + + + + + + + + + + + + + + {% for list in bsproject %} + + + + + + + + + {% endfor %} + + +
ID项目名姓名手机号码录取情况
ID项目名姓名手机号码录取情况
{{ forloop.counter }} + {{ list.bsproject.name}}{{ list.myuser.realname}}{{ list.myuser.phone_number }}{{ list.get_lqqk_display }}
+ +
+
+
+ +
+ + +{% if form.errors %} + +{% for field, error in form.errors.items %} +
+ {{ field }} {{ error }} +
+{% endfor %} + + +{% endif %} + + + +
+ {% csrf_token %} + +
+ +{% endblock %} \ No newline at end of file diff --git a/Weiguang/templates/weibo.html b/Weiguang/templates/weibo.html new file mode 100644 index 0000000..f09eb9b --- /dev/null +++ b/Weiguang/templates/weibo.html @@ -0,0 +1,74 @@ +{% extends "base.html" %} +{% block staticjs %} + + + +{% endblock %} +{% block content %} + +

人员管理

+