初始化

This commit is contained in:
xiaotxiaox 2019-03-18 19:31:50 +08:00
parent 2ff89ca93e
commit fd323c62b1
544 changed files with 86614 additions and 0 deletions

View File

@ -0,0 +1,31 @@
<?xml version="1.0" encoding="UTF-8"?>
<module type="PYTHON_MODULE" version="4">
<component name="FacetManager">
<facet type="django" name="Django">
<configuration>
<option name="rootFolder" value="$MODULE_DIR$" />
<option name="settingsModule" value="ConstructionConsultationSystem/settings.py" />
<option name="manageScript" value="$MODULE_DIR$/manage.py" />
<option name="environment" value="&lt;map/&gt;" />
<option name="doNotUseTestRunner" value="false" />
<option name="trackFilePattern" value="migrations" />
</configuration>
</facet>
</component>
<component name="NewModuleRootManager">
<content url="file://$MODULE_DIR$" />
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
<component name="TemplatesService">
<option name="TEMPLATE_CONFIGURATION" value="Django" />
<option name="TEMPLATE_FOLDERS">
<list>
<option value="$MODULE_DIR$/User/templates" />
</list>
</option>
</component>
<component name="TestRunnerService">
<option name="PROJECT_TEST_RUNNER" value="Unittests" />
</component>
</module>

7
.idea/misc.xml Normal file
View File

@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="JavaScriptSettings">
<option name="languageLevel" value="ES6" />
</component>
<component name="ProjectRootManager" version="2" project-jdk-name="Pipenv (ConstructionConsultationSystem)" project-jdk-type="Python SDK" />
</project>

8
.idea/modules.xml Normal file
View File

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/.idea/ConstructionConsultationSystem.iml" filepath="$PROJECT_DIR$/.idea/ConstructionConsultationSystem.iml" />
</modules>
</component>
</project>

377
.idea/workspace.xml Normal file
View File

@ -0,0 +1,377 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ChangeListManager">
<list default="true" id="af030b5d-948a-430a-b9df-7dc6afb90853" name="Default Changelist" comment="" />
<option name="EXCLUDED_CONVERTED_TO_IGNORED" value="true" />
<option name="SHOW_DIALOG" value="false" />
<option name="HIGHLIGHT_CONFLICTS" value="true" />
<option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
<option name="LAST_RESOLUTION" value="IGNORE" />
</component>
<component name="DjangoConsoleOptions" custom-start-script="import sys; print('Python %s on %s' % (sys.version, sys.platform))&#10;import django; print('Django %s' % django.get_version())&#10;sys.path.extend([WORKING_DIR_AND_PYTHON_PATHS])&#10;if 'setup' in dir(django): django.setup()&#10;import django_manage_shell; django_manage_shell.run(PROJECT_ROOT)">
<option name="myCustomStartScript" value="import sys; print('Python %s on %s' % (sys.version, sys.platform))&#10;import django; print('Django %s' % django.get_version())&#10;sys.path.extend([WORKING_DIR_AND_PYTHON_PATHS])&#10;if 'setup' in dir(django): django.setup()&#10;import django_manage_shell; django_manage_shell.run(PROJECT_ROOT)" />
</component>
<component name="FUSProjectUsageTrigger">
<session id="-543407974">
<usages-collector id="statistics.lifecycle.project">
<counts>
<entry key="project.closed" value="1" />
<entry key="project.open.time.610" value="1" />
<entry key="project.opened" value="1" />
</counts>
</usages-collector>
<usages-collector id="statistics.file.extensions.open">
<counts>
<entry key="Pipfile" value="2" />
<entry key="html" value="1" />
<entry key="lock" value="1" />
<entry key="py" value="35" />
</counts>
</usages-collector>
<usages-collector id="statistics.file.types.open">
<counts>
<entry key="HTML" value="1" />
<entry key="PLAIN_TEXT" value="1" />
<entry key="Python" value="35" />
<entry key="TOML" value="2" />
</counts>
</usages-collector>
<usages-collector id="statistics.file.extensions.edit">
<counts>
<entry key="py" value="408" />
<entry key="py@ConstructionConsultationSystem" value="199" />
</counts>
</usages-collector>
<usages-collector id="statistics.file.types.edit">
<counts>
<entry key="CommandLine" value="157" />
<entry key="PLAIN_TEXT" value="42" />
<entry key="Python" value="408" />
</counts>
</usages-collector>
</session>
</component>
<component name="FileEditorManager">
<leaf />
</component>
<component name="FileTemplateManagerImpl">
<option name="RECENT_TEMPLATES">
<list>
<option value="Python Script" />
</list>
</option>
</component>
<component name="IdeDocumentHistory">
<option name="CHANGED_PATHS">
<list>
<option value="$PROJECT_DIR$/Pipfile" />
<option value="$PROJECT_DIR$/ProjectInfoDisplay/serializers.py" />
<option value="$PROJECT_DIR$/ProjectInfoDisplay/views.py" />
<option value="$PROJECT_DIR$/ProjectInfoDisplay/apps.py" />
<option value="$PROJECT_DIR$/ProjectInfoDisplay/__init__.py" />
<option value="$PROJECT_DIR$/ProjectInfoDisplay/adminx.py" />
<option value="$PROJECT_DIR$/ConstructionConsultationSystem/settings.py" />
<option value="$PROJECT_DIR$/ProjectInfoDisplay/urls.py" />
<option value="$PROJECT_DIR$/User/urls.py" />
<option value="$PROJECT_DIR$/User/views.py" />
<option value="$PROJECT_DIR$/ConstructionConsultationSystem/urls.py" />
</list>
</option>
</component>
<component name="JsBuildToolGruntFileManager" detection-done="true" sorting="DEFINITION_ORDER" />
<component name="JsBuildToolPackageJson" detection-done="true" sorting="DEFINITION_ORDER" />
<component name="JsGulpfileManager">
<detection-done>true</detection-done>
<sorting>DEFINITION_ORDER</sorting>
</component>
<component name="ProjectFrameBounds" extendedState="7">
<option name="x" value="705" />
<option name="width" value="1230" />
<option name="height" value="1045" />
</component>
<component name="ProjectView">
<navigator proportions="" version="1">
<foldersAlwaysOnTop value="true" />
</navigator>
<panes>
<pane id="Scope" />
<pane id="ProjectPane">
<subPane>
<expand>
<path>
<item name="ConstructionConsultationSystem" type="b2602c69:ProjectViewProjectNode" />
<item name="ConstructionConsultationSystem" type="462c0819:PsiDirectoryNode" />
</path>
</expand>
<select />
</subPane>
</pane>
</panes>
</component>
<component name="PropertiesComponent">
<property name="WebServerToolWindowFactoryState" value="false" />
<property name="last_opened_file_path" value="$PROJECT_DIR$/../WHProjectManagementSystem/WHProjectManagementSystem" />
<property name="nodejs_interpreter_path.stuck_in_default_project" value="undefined stuck path" />
<property name="nodejs_npm_path_reset_for_default_project" value="true" />
<property name="settings.editor.selected.configurable" value="com.jetbrains.python.configuration.PyActiveSdkModuleConfigurable" />
</component>
<component name="RecentsManager">
<key name="CopyFile.RECENT_KEYS">
<recent name="E:\项目\ConstructionConsultationSystem\User\templates\user" />
<recent name="E:\项目\ConstructionConsultationSystem\VideoDisplay" />
<recent name="E:\项目\ConstructionConsultationSystem\SystemSettings" />
<recent name="E:\项目\ConstructionConsultationSystem\ProjectInfoDisplay" />
<recent name="E:\项目\ConstructionConsultationSystem\ImplementationPhase" />
</key>
</component>
<component name="RunDashboard">
<option name="ruleStates">
<list>
<RuleState>
<option name="name" value="ConfigurationTypeDashboardGroupingRule" />
</RuleState>
<RuleState>
<option name="name" value="StatusDashboardGroupingRule" />
</RuleState>
</list>
</option>
</component>
<component name="RunManager">
<configuration name="ConstructionConsultationSystem" type="Python.DjangoServer" factoryName="Django server">
<module name="ConstructionConsultationSystem" />
<option name="INTERPRETER_OPTIONS" value="" />
<option name="PARENT_ENVS" value="true" />
<envs>
<env name="PYTHONUNBUFFERED" value="1" />
<env name="DJANGO_SETTINGS_MODULE" value="ConstructionConsultationSystem.settings" />
</envs>
<option name="SDK_HOME" value="D:\Python\Envs\ConstructionConsultationSystem-UJHFiZWw\Scripts\python.exe" />
<option name="WORKING_DIRECTORY" value="" />
<option name="IS_MODULE_SDK" value="false" />
<option name="ADD_CONTENT_ROOTS" value="true" />
<option name="ADD_SOURCE_ROOTS" value="true" />
<option name="launchJavascriptDebuger" value="false" />
<option name="port" value="8000" />
<option name="host" value="" />
<option name="additionalOptions" value="" />
<option name="browserUrl" value="" />
<option name="runTestServer" value="false" />
<option name="runNoReload" value="false" />
<option name="useCustomRunCommand" value="false" />
<option name="customRunCommand" value="" />
<method v="2" />
</configuration>
</component>
<component name="SvnConfiguration">
<configuration />
</component>
<component name="TaskManager">
<task active="true" id="Default" summary="Default task">
<changelist id="af030b5d-948a-430a-b9df-7dc6afb90853" name="Default Changelist" comment="" />
<created>1552883375225</created>
<option name="number" value="Default" />
<option name="presentableId" value="Default" />
<updated>1552883375225</updated>
</task>
<servers />
</component>
<component name="ToolWindowManager">
<frame x="-7" y="-7" width="1550" height="838" extended-state="7" />
<layout>
<window_info id="Favorites" side_tool="true" />
<window_info active="true" content_ui="combo" id="Project" order="0" visible="true" weight="0.20107238" />
<window_info id="Structure" order="1" side_tool="true" weight="0.25" />
<window_info anchor="bottom" id="manage.py@ConstructionConsultationSystem" weight="0.3286119" />
<window_info anchor="bottom" id="Docker" show_stripe_button="false" />
<window_info anchor="bottom" id="Database Changes" show_stripe_button="false" />
<window_info anchor="bottom" id="Version Control" show_stripe_button="false" />
<window_info anchor="bottom" id="Python Console" />
<window_info anchor="bottom" id="Terminal" weight="0.3286119" />
<window_info anchor="bottom" id="Event Log" side_tool="true" />
<window_info anchor="bottom" id="Message" order="0" />
<window_info anchor="bottom" id="Find" order="1" />
<window_info anchor="bottom" id="Run" order="2" weight="0.3286119" />
<window_info anchor="bottom" id="Debug" order="3" weight="0.39943343" />
<window_info anchor="bottom" id="Cvs" order="4" weight="0.25" />
<window_info anchor="bottom" id="Inspection" order="5" weight="0.4" />
<window_info anchor="bottom" id="TODO" order="6" />
<window_info anchor="right" id="SciView" />
<window_info anchor="right" id="Database" />
<window_info anchor="right" id="Commander" internal_type="SLIDING" order="0" type="SLIDING" weight="0.4" />
<window_info anchor="right" id="Ant Build" order="1" weight="0.25" />
<window_info anchor="right" content_ui="combo" id="Hierarchy" order="2" weight="0.25" />
</layout>
</component>
<component name="TypeScriptGeneratedFilesManager">
<option name="version" value="1" />
</component>
<component name="VcsContentAnnotationSettings">
<option name="myLimit" value="2678400000" />
</component>
<component name="editorHistoryManager">
<entry file="file://$PROJECT_DIR$/Pipfile.lock">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="-654" />
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/Pipfile">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="76">
<caret line="2" column="47" selection-start-line="2" selection-start-column="47" selection-end-line="2" selection-end-column="47" />
</state>
</provider>
</entry>
<entry file="file://D:/Python/Envs/ConstructionConsultationSystem-UJHFiZWw/Lib/site-packages/rest_framework/routers.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="141">
<caret line="362" column="32" selection-start-line="362" selection-start-column="32" selection-end-line="362" selection-end-column="32" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/ProjectInfoDisplay/views.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="-266">
<caret line="11" selection-start-line="11" selection-end-line="11" />
<folding>
<element signature="e#0#35#0" expanded="true" />
<marker date="1552894401056" expanded="true" signature="259:343" ph="..." />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/ProjectInfoDisplay/serializers.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="424">
<caret line="13" column="32" selection-start-line="13" selection-start-column="32" selection-end-line="13" selection-end-column="32" />
<folding>
<element signature="e#0#50#0" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="file://D:/Python/Envs/ConstructionConsultationSystem-UJHFiZWw/Lib/site-packages/django/db/backends/sqlite3/base.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="149">
<caret line="297" selection-start-line="297" selection-end-line="297" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/ProjectInfoDisplay/apps.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="190">
<caret line="5" column="24" selection-start-line="5" selection-start-column="24" selection-end-line="5" selection-end-column="24" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/ProjectInfoDisplay/__init__.py">
<provider selected="true" editor-type-id="text-editor">
<state>
<caret column="20" selection-start-column="20" selection-end-column="20" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/ConstructionConsultationSystem/settings.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="4218">
<caret line="132" column="36" selection-start-line="132" selection-start-column="36" selection-end-line="132" selection-end-column="36" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/CompletionPhase/serializers.py">
<provider selected="true" editor-type-id="text-editor" />
</entry>
<entry file="file://$PROJECT_DIR$/ConstructionConsultationSystem/serializers.py">
<provider selected="true" editor-type-id="text-editor" />
</entry>
<entry file="file://$PROJECT_DIR$/SystemSettings/serializers.py">
<provider selected="true" editor-type-id="text-editor" />
</entry>
<entry file="file://$PROJECT_DIR$/User/serializers.py">
<provider selected="true" editor-type-id="text-editor" />
</entry>
<entry file="file://$PROJECT_DIR$/VideoDisplay/serializers.py">
<provider selected="true" editor-type-id="text-editor" />
</entry>
<entry file="file://$PROJECT_DIR$/ImplementationPhase/serializers.py">
<provider selected="true" editor-type-id="text-editor" />
</entry>
<entry file="file://$PROJECT_DIR$/DecisionPhase/serializers.py">
<provider selected="true" editor-type-id="text-editor" />
</entry>
<entry file="file://$PROJECT_DIR$/CompletionPhase/urls.py">
<provider selected="true" editor-type-id="text-editor" />
</entry>
<entry file="file://$PROJECT_DIR$/DecisionPhase/urls.py">
<provider selected="true" editor-type-id="text-editor" />
</entry>
<entry file="file://$PROJECT_DIR$/ImplementationPhase/urls.py">
<provider selected="true" editor-type-id="text-editor" />
</entry>
<entry file="file://$PROJECT_DIR$/SystemSettings/urls.py">
<provider selected="true" editor-type-id="text-editor" />
</entry>
<entry file="file://$PROJECT_DIR$/VideoDisplay/urls.py">
<provider selected="true" editor-type-id="text-editor" />
</entry>
<entry file="file://$PROJECT_DIR$/ProjectInfoDisplay/urls.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="152">
<caret line="4" column="1" selection-start-line="4" selection-start-column="1" selection-end-line="4" selection-end-column="1" />
<folding>
<element signature="e#0#36#0" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/User/templates/user/base.html">
<provider selected="true" editor-type-id="text-editor" />
</entry>
<entry file="file://$PROJECT_DIR$/ConstructionConsultationSystem/urls.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="532">
<caret line="35" column="39" lean-forward="true" selection-start-line="35" selection-start-column="39" selection-end-line="35" selection-end-column="39" />
<folding>
<element signature="e#654#686#0" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/ProjectInfoDisplay/adminx.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="228">
<caret line="9" lean-forward="true" selection-start-line="9" selection-end-line="9" />
<folding>
<element signature="e#0#13#0" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/User/views.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="380">
<caret line="135" column="12" selection-start-line="135" selection-start-column="12" selection-end-line="135" selection-end-column="12" />
<folding>
<element signature="e#573#689#0" />
<element signature="e#718#1914#0" />
<element signature="e#1944#2025#0" />
<element signature="e#2062#3008#0" />
<element signature="e#3046#3603#0" />
<element signature="e#3646#3793#0" />
<element signature="e#3839#4607#0" />
<element signature="e#4649#4774#0" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/User/urls.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="190">
<caret line="5" column="57" selection-start-line="5" selection-start-column="57" selection-end-line="5" selection-end-column="57" />
<folding>
<element signature="e#0#36#0" expanded="true" />
</folding>
</state>
</provider>
</entry>
</component>
</project>

View File

Binary file not shown.

Binary file not shown.

Binary file not shown.

3
CompletionPhase/admin.py Normal file
View File

@ -0,0 +1,3 @@
from django.contrib import admin
# Register your models here.

5
CompletionPhase/apps.py Normal file
View File

@ -0,0 +1,5 @@
from django.apps import AppConfig
class CompletionphaseConfig(AppConfig):
name = 'CompletionPhase'

View File

View File

@ -0,0 +1,3 @@
from django.db import models
# Create your models here.

View File

@ -0,0 +1,14 @@
from django.contrib.auth.models import User, Group
from rest_framework import serializers
class UserSerializer(serializers.HyperlinkedModelSerializer):
class Meta:
model = User
fields = ('url', 'username', 'email', 'groups')
class GroupSerializer(serializers.HyperlinkedModelSerializer):
class Meta:
model = Group
fields = ('url', 'name')

3
CompletionPhase/tests.py Normal file
View File

@ -0,0 +1,3 @@
from django.test import TestCase
# Create your tests here.

5
CompletionPhase/urls.py Normal file
View File

@ -0,0 +1,5 @@
from django.urls import path,include
from . import views
urlpatterns = [
# path('',views.ProjectInfoDispalyView.as_view(),name='ProjectInfoDisplay')
]

3
CompletionPhase/views.py Normal file
View File

@ -0,0 +1,3 @@
from django.shortcuts import render
# Create your views here.

View File

@ -0,0 +1,133 @@
"""
Django settings for ConstructionConsultationSystem project.
Generated by 'django-admin startproject' using Django 2.1.7.
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, ...)
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 = 'jh)1v3!d)ho3b1!thsy_h!&sf3-m%mhz)3!+r*38_)(ksew6k%'
# 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',
'rest_framework',
'xadmin',
'crispy_forms',
]
REST_FRAMEWORK = {
'DEFAULT_PERMISSION_CLASSES': [
'rest_framework.permissions.DjangoModelPermissionsOrAnonReadOnly'
]
}
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 = 'ConstructionConsultationSystem.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 = 'ConstructionConsultationSystem.wsgi.application'
# Database
# https://docs.djangoproject.com/en/2.1/ref/settings/#databases
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': os.path.join(BASE_DIR, 'db.sqlite3'),
}
}
# 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',
},
]
# 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/
MEDIA_URL = '/media/'
MEDIA_ROOT = os.path.join(BASE_DIR, 'media/')
STATIC_URL = '/static/'
STATICFILES_DIRS = [
os.path.join(BASE_DIR, 'static')]

View File

@ -0,0 +1,37 @@
"""ConstructionConsultationSystem URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/2.1/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: path('', views.home, name='home')
Class-based views
1. Add an import: from other_app.views import Home
2. Add a URL to urlpatterns: path('', Home.as_view(), name='home')
Including another URLconf
1. Import the include() function: from django.urls import include, path
2. Add a URL to urlpatterns: path('blog/', include('blog.urls'))
"""
from django.contrib import admin
import xadmin
from django.urls import path,include
from rest_framework import routers
from ProjectInfoDisplay import views
router = routers.DefaultRouter()
router.register(r'users', views.UserViewSet)
router.register(r'groups', views.GroupViewSet)
urlpatterns = [
path('xadmin/', xadmin.site.urls),
path('api-auth/', include('rest_framework.urls')),
path('user/',include(('User.urls','User'),namespace='User')),
path('pid/',include(('ProjectInfoDisplay.urls','ProjectInfoDisplay'),namespace='ProjectInfoDisplay')),
path('dp/',include(('DecisionPhase.urls','DecisionPhase'),namespace='DecisionPhase')),
path('ip/',include(('ImplementationPhase.urls','ImplementationPhase'),namespace='ImplementationPhase')),
path('cp/',include(('CompletionPhase.urls','CompletionPhase'),namespace='CompletionPhase')),
path('vd/',include(('VideoDisplay.urls','VideoDisplay'),namespace='VideoDisplay')),
path('ss/',include(('SystemSettings.urls','SystemSettings'),namespace='SystemSettings')),
path('api/', include(router.urls)),
]

View File

@ -0,0 +1,16 @@
"""
WSGI config for ConstructionConsultationSystem project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/2.1/howto/deployment/wsgi/
"""
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'ConstructionConsultationSystem.settings')
application = get_wsgi_application()

View File

Binary file not shown.

Binary file not shown.

Binary file not shown.

3
DecisionPhase/admin.py Normal file
View File

@ -0,0 +1,3 @@
from django.contrib import admin
# Register your models here.

5
DecisionPhase/apps.py Normal file
View File

@ -0,0 +1,5 @@
from django.apps import AppConfig
class DecisionphaseConfig(AppConfig):
name = 'DecisionPhase'

View File

3
DecisionPhase/models.py Normal file
View File

@ -0,0 +1,3 @@
from django.db import models
# Create your models here.

View File

@ -0,0 +1,14 @@
from django.contrib.auth.models import User, Group
from rest_framework import serializers
class UserSerializer(serializers.HyperlinkedModelSerializer):
class Meta:
model = User
fields = ('url', 'username', 'email', 'groups')
class GroupSerializer(serializers.HyperlinkedModelSerializer):
class Meta:
model = Group
fields = ('url', 'name')

3
DecisionPhase/tests.py Normal file
View File

@ -0,0 +1,3 @@
from django.test import TestCase
# Create your tests here.

5
DecisionPhase/urls.py Normal file
View File

@ -0,0 +1,5 @@
from django.urls import path,include
from . import views
urlpatterns = [
# path('',views.ProjectInfoDispalyView.as_view(),name='ProjectInfoDisplay')
]

3
DecisionPhase/views.py Normal file
View File

@ -0,0 +1,3 @@
from django.shortcuts import render
# Create your views here.

View File

Binary file not shown.

Binary file not shown.

View File

@ -0,0 +1,3 @@
from django.contrib import admin
# Register your models here.

View File

@ -0,0 +1,5 @@
from django.apps import AppConfig
class ImplementationphaseConfig(AppConfig):
name = 'ImplementationPhase'

View File

@ -0,0 +1,3 @@
from django.db import models
# Create your models here.

View File

@ -0,0 +1,14 @@
from django.contrib.auth.models import User, Group
from rest_framework import serializers
class UserSerializer(serializers.HyperlinkedModelSerializer):
class Meta:
model = User
fields = ('url', 'username', 'email', 'groups')
class GroupSerializer(serializers.HyperlinkedModelSerializer):
class Meta:
model = Group
fields = ('url', 'name')

View File

@ -0,0 +1,3 @@
from django.test import TestCase
# Create your tests here.

View File

@ -0,0 +1,5 @@
from django.urls import path,include
from . import views
urlpatterns = [
# path('',views.ProjectInfoDispalyView.as_view(),name='ProjectInfoDisplay')
]

View File

@ -0,0 +1,3 @@
from django.shortcuts import render
# Create your views here.

21
Pipfile Normal file
View File

@ -0,0 +1,21 @@
[[source]]
name = "pypi"
url = "https://pypi.tuna.tsinghua.edu.cn/simple"
verify_ssl = true
[dev-packages]
[packages]
django = "*"
djangorestframework = "*"
django-filter = "*"
future = "*"
django-crispy-forms = "*"
django-formtools = "*"
httplib2 = "*"
six = "*"
django-import-export = "*"
django-reversion = "*"
[requires]
python_version = "3.7"

188
Pipfile.lock generated Normal file
View File

@ -0,0 +1,188 @@
{
"_meta": {
"hash": {
"sha256": "413084301e2ab2e30f0a0fee75ce9635a9b82ac764140ed486d80baf80f3c2d2"
},
"pipfile-spec": 6,
"requires": {
"python_version": "3.7"
},
"sources": [
{
"name": "pypi",
"url": "https://pypi.tuna.tsinghua.edu.cn/simple",
"verify_ssl": true
}
]
},
"default": {
"backports.csv": {
"hashes": [
"sha256:1277dfff73130b2e106bf3dd347adb3c5f6c4340882289d88f31240da92cbd6d",
"sha256:21f6e09bab589e6c1f877edbc40277b65e626262a86e69a70137db714eaac5ce"
],
"version": "==1.0.7"
},
"defusedxml": {
"hashes": [
"sha256:24d7f2f94f7f3cb6061acb215685e5125fbcdc40a857eff9de22518820b0a4f4",
"sha256:702a91ade2968a82beb0db1e0766a6a273f33d4616a6ce8cde475d8e09853b20"
],
"version": "==0.5.0"
},
"diff-match-patch": {
"hashes": [
"sha256:a809a996d0f09b9bbd59e9bbd0b71eed8c807922512910e05cbd3f9480712ddb"
],
"version": "==20181111"
},
"django": {
"hashes": [
"sha256:275bec66fd2588dd517ada59b8bfb23d4a9abc5a362349139ddda3c7ff6f5ade",
"sha256:939652e9d34d7d53d74d5d8ef82a19e5f8bb2de75618f7e5360691b6e9667963"
],
"index": "pypi",
"version": "==2.1.7"
},
"django-crispy-forms": {
"hashes": [
"sha256:5952bab971110d0b86c278132dae0aa095beee8f723e625c3d3fa28888f1675f",
"sha256:705ededc554ad8736157c666681165fe22ead2dec0d5446d65fc9dd976a5a876"
],
"index": "pypi",
"version": "==1.7.2"
},
"django-filter": {
"hashes": [
"sha256:3dafb7d2810790498895c22a1f31b2375795910680ac9c1432821cbedb1e176d",
"sha256:a3014de317bef0cd43075a0f08dfa1d319a7ccc5733c3901fb860da70b0dda68"
],
"index": "pypi",
"version": "==2.1.0"
},
"django-formtools": {
"hashes": [
"sha256:7703793f1675aa6e871f9fed147e8563816d7a5b9affdc5e3459899596217f7c",
"sha256:cb2bd7c29c2104278e5a0e76f7ff256b9570acf11485d547ee0c1b35347359fb"
],
"index": "pypi",
"version": "==2.1"
},
"django-import-export": {
"hashes": [
"sha256:830824f79aae39e4212bb03aabdd83dc57931420557b757981cf6add8d07e611",
"sha256:99fae7d963af4ade97af9237a843f250312421fa4ee350a3b735fcc5684c3fb5"
],
"index": "pypi",
"version": "==1.2.0"
},
"django-reversion": {
"hashes": [
"sha256:830cd9127ff3cda98254526e1b30519da98ce4094bdf25e7c5aabb9207405a76",
"sha256:fd910774f2dabb65ac9d4fec2b032f1c0560f870c4923ce0b1e2f4d4430fc04a"
],
"index": "pypi",
"version": "==3.0.3"
},
"djangorestframework": {
"hashes": [
"sha256:8a435df9007c8b7d8e69a21ef06650e3c0cbe0d4b09e55dd1bd74c89a75a9fcd",
"sha256:f7a266260d656e1cf4ca54d7a7349609dc8af4fe2590edd0ecd7d7643ea94a17"
],
"index": "pypi",
"version": "==3.9.2"
},
"et-xmlfile": {
"hashes": [
"sha256:614d9722d572f6246302c4491846d2c393c199cfa4edc9af593437691683335b"
],
"version": "==1.0.1"
},
"future": {
"hashes": [
"sha256:67045236dcfd6816dc439556d009594abf643e5eb48992e36beac09c2ca659b8"
],
"index": "pypi",
"version": "==0.17.1"
},
"httplib2": {
"hashes": [
"sha256:4ba6b8fd77d0038769bf3c33c9a96a6f752bc4cdf739701fdcaf210121f399d4"
],
"index": "pypi",
"version": "==0.12.1"
},
"jdcal": {
"hashes": [
"sha256:948fb8d079e63b4be7a69dd5f0cd618a0a57e80753de8248fd786a8a20658a07",
"sha256:ea0a5067c5f0f50ad4c7bdc80abad3d976604f6fb026b0b3a17a9d84bb9046c9"
],
"version": "==1.4"
},
"odfpy": {
"hashes": [
"sha256:596021f0519623ca8717331951c95e3b8d7b21e86edc7efe8cb650a0d0f59a2b"
],
"version": "==1.4.0"
},
"openpyxl": {
"hashes": [
"sha256:9e4db4ee7aadd0ff7a814f7483b2d94e6b8d4f14dff780b023c5bdc94af54dd5"
],
"version": "==2.6.1"
},
"pytz": {
"hashes": [
"sha256:32b0891edff07e28efe91284ed9c31e123d84bea3fd98e1f72be2508f43ef8d9",
"sha256:d5f05e487007e29e03409f9398d074e158d920d36eb82eaf66fb1136b0c5374c"
],
"version": "==2018.9"
},
"pyyaml": {
"hashes": [
"sha256:1adecc22f88d38052fb787d959f003811ca858b799590a5eaa70e63dca50308c",
"sha256:436bc774ecf7c103814098159fbb84c2715d25980175292c648f2da143909f95",
"sha256:460a5a4248763f6f37ea225d19d5c205677d8d525f6a83357ca622ed541830c2",
"sha256:5a22a9c84653debfbf198d02fe592c176ea548cccce47553f35f466e15cf2fd4",
"sha256:7a5d3f26b89d688db27822343dfa25c599627bc92093e788956372285c6298ad",
"sha256:9372b04a02080752d9e6f990179a4ab840227c6e2ce15b95e1278456664cf2ba",
"sha256:a5dcbebee834eaddf3fa7366316b880ff4062e4bcc9787b78c7fbb4a26ff2dd1",
"sha256:aee5bab92a176e7cd034e57f46e9df9a9862a71f8f37cad167c6fc74c65f5b4e",
"sha256:c51f642898c0bacd335fc119da60baae0824f2cde95b0330b56c0553439f0673",
"sha256:c68ea4d3ba1705da1e0d85da6684ac657912679a649e8868bd850d2c299cce13",
"sha256:e23d0cc5299223dcc37885dae624f382297717e459ea24053709675a976a3e19"
],
"version": "==5.1"
},
"six": {
"hashes": [
"sha256:3350809f0555b11f552448330d0b52d5f24c91a322ea4a15ef22629740f3761c",
"sha256:d16a0141ec1a18405cd4ce8b4613101da75da0e9a7aec5bdd4fa804d0e0eba73"
],
"index": "pypi",
"version": "==1.12.0"
},
"tablib": {
"hashes": [
"sha256:0f88a9cebdaa1a2cc29ae57387082ee81015d1149ecd34e48a8c8d3b4dd21670",
"sha256:5f33c079b07eb10cf9c4b4696add2ecf32c89db7729240546ecdcd5c92f67e13"
],
"version": "==0.13.0"
},
"xlrd": {
"hashes": [
"sha256:546eb36cee8db40c3eaa46c351e67ffee6eeb5fa2650b71bc4c758a29a1b29b2",
"sha256:e551fb498759fa3a5384a94ccd4c3c02eb7c00ea424426e212ac0c57be9dfbde"
],
"version": "==1.2.0"
},
"xlwt": {
"hashes": [
"sha256:a082260524678ba48a297d922cc385f58278b8aa68741596a87de01a9c628b2e",
"sha256:c59912717a9b28f1a3c2a98fd60741014b06b043936dcecbc113eaaada156c88"
],
"version": "==1.3.0"
}
},
"develop": {}
}

View File

@ -0,0 +1 @@
default_app_config = "ProjectInfoDisplay.apps.ProjectinfodisplayConfig"

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -0,0 +1,3 @@
from django.contrib import admin
# Register your models here.

View File

@ -0,0 +1,26 @@
import xadmin
from xadmin import views
from xadmin import views
class GlobalSetting(object):
site_title = "建设咨询系统后台管理系统"
site_footer = "http://www."
menu_style = "accordion"
class BaseSetting(object):
enable_themes = True
use_bootswatch = True
xadmin.site.register(views.CommAdminView, GlobalSetting)
xadmin.site.register(views.BaseAdminView, BaseSetting)
# from .models import EmailVerifyRecord
#
#
# class EmailVerifyRecordAdmin(object):
# list_display = ['code', 'email', 'send_type', 'send_time']
# search_fields = ['code', 'email', 'send_type']
# list_filter = ['code', 'email', 'send_type', 'send_time']
# model_icon = 'fa fa-address-book-o'
#
# xadmin.site.register(EmailVerifyRecord, EmailVerifyRecordAdmin)

View File

@ -0,0 +1,6 @@
from django.apps import AppConfig
class ProjectinfodisplayConfig(AppConfig):
name = 'ProjectInfoDisplay'
verbose_name = '工程信息'

View File

@ -0,0 +1,3 @@
from django.db import models
# Create your models here.

View File

@ -0,0 +1,14 @@
from django.contrib.auth.models import User, Group
from rest_framework import serializers
class UserSerializer(serializers.HyperlinkedModelSerializer):
class Meta:
model = User
fields = ('url', 'username', 'email', 'groups')
class GroupSerializer(serializers.HyperlinkedModelSerializer):
class Meta:
model = Group
fields = ('url', 'name')

View File

@ -0,0 +1,3 @@
from django.test import TestCase
# Create your tests here.

View File

@ -0,0 +1,5 @@
from django.urls import path,include
from . import views
urlpatterns = [
path('',views.ProjectInfoDispalyView.as_view(),name='ProjectInfoDisplay')
]

View File

@ -0,0 +1,27 @@
from django.shortcuts import render
from django.contrib.auth.models import User, Group
from rest_framework import viewsets
from .serializers import UserSerializer, GroupSerializer
from django.views.generic.base import View
class ProjectInfoDispalyView(View):
def get(self, request):
pass
def post(self,request):
pass
class UserViewSet(viewsets.ModelViewSet):
"""
API endpoint that allows users to be viewed or edited.
"""
queryset = User.objects.all().order_by('-date_joined')
serializer_class = UserSerializer
class GroupViewSet(viewsets.ModelViewSet):
"""
API endpoint that allows groups to be viewed or edited.
"""
queryset = Group.objects.all()
serializer_class = GroupSerializer

View File

Binary file not shown.

Binary file not shown.

Binary file not shown.

3
SystemSettings/admin.py Normal file
View File

@ -0,0 +1,3 @@
from django.contrib import admin
# Register your models here.

5
SystemSettings/apps.py Normal file
View File

@ -0,0 +1,5 @@
from django.apps import AppConfig
class SystemsettingsConfig(AppConfig):
name = 'SystemSettings'

View File

3
SystemSettings/models.py Normal file
View File

@ -0,0 +1,3 @@
from django.db import models
# Create your models here.

View File

@ -0,0 +1,14 @@
from django.contrib.auth.models import User, Group
from rest_framework import serializers
class UserSerializer(serializers.HyperlinkedModelSerializer):
class Meta:
model = User
fields = ('url', 'username', 'email', 'groups')
class GroupSerializer(serializers.HyperlinkedModelSerializer):
class Meta:
model = Group
fields = ('url', 'name')

3
SystemSettings/tests.py Normal file
View File

@ -0,0 +1,3 @@
from django.test import TestCase
# Create your tests here.

5
SystemSettings/urls.py Normal file
View File

@ -0,0 +1,5 @@
from django.urls import path,include
from . import views
urlpatterns = [
# path('',views.ProjectInfoDispalyView.as_view(),name='ProjectInfoDisplay')
]

3
SystemSettings/views.py Normal file
View File

@ -0,0 +1,3 @@
from django.shortcuts import render
# Create your views here.

0
User/__init__.py Normal file
View File

Binary file not shown.

Binary file not shown.

Binary file not shown.

3
User/admin.py Normal file
View File

@ -0,0 +1,3 @@
from django.contrib import admin
# Register your models here.

5
User/apps.py Normal file
View File

@ -0,0 +1,5 @@
from django.apps import AppConfig
class UserConfig(AppConfig):
name = 'User'

View File

3
User/models.py Normal file
View File

@ -0,0 +1,3 @@
from django.db import models
# Create your models here.

14
User/serializers.py Normal file
View File

@ -0,0 +1,14 @@
from django.contrib.auth.models import User, Group
from rest_framework import serializers
class UserSerializer(serializers.HyperlinkedModelSerializer):
class Meta:
model = User
fields = ('url', 'username', 'email', 'groups')
class GroupSerializer(serializers.HyperlinkedModelSerializer):
class Meta:
model = Group
fields = ('url', 'name')

View File

@ -0,0 +1,93 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta property="twitter:card" content="summary_large_image">
<meta property="twitter:site" content="@pratikborsadiya">
<meta property="twitter:creator" content="@pratikborsadiya">
<title>登录</title>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" type="text/css" href="../../../static/css/main.css">
<link rel="stylesheet" type="text/css" href="../../../static/css/bootstrap.css">
<link href="../../../static/css/customValidator.css" rel="stylesheet">
<link rel="stylesheet" type="text/css" href="../../../static/css/font-awesome.css">
<link rel="stylesheet" type="text/css" href="../../../static/css/login.css">
</head>
<body>
<header class="app-header">
<a class="app-header__logo" href="#">项目审核系统</a>
<ul class="app-nav">
<li><a class="app-nav__item" href="{% url 'user:login' %}">登录</a></li>
<li><a class="app-nav__item" href="{% url 'user:register' %}">注册</a></li>
</ul>
</header>
<main>
<!--弹出层窗体-->
<div class="layer-mask"></div>
<div id="layer-pop" class="layer-pop">
<!--弹出层内容区域-->
<div id="forHtml" class="layer-content">
<div class="col-md-10 col-md-offset-1">
<div class="passFor" style="text-align: center;">
<h2 style="text-align: center">重置密码</h2>
<form id="reset_form" method="post" action="{% url 'user:ForgetPassword' %}">
{% csrf_token %}
<div class="form-group" style="margin-top: 55px">
<div class="input-group">
<span class="input-group-addon"><span class="glyphicon glyphicon-user"></span></span>
<input id="formGroupUsername" name="email" class="form-control required" type="text" placeholder="请输入你的邮箱" />
</div>
</div>
{% if msg %}
<div class="form-group" style="margin-top: 20px">
<p id='inform' style="font-size: 15px;color:#c82333">{{ msg }}</p>
</div>
{% endif %}
<div class="form-group" style="margin-top: 35px">
<button class="btn btn-primary" type="submit" id="next">下一步</button>
</div>
</form>
</div>
</div>
</div>
</div>
</main>
<script src="../../../static/js/jquery-3.3.1.min.js" type="text/javascript"></script>
<script src="../../../static/js/bootstrap.min.js" type="text/javascript"></script>
<script src="../../../static/js/zh_CN.js" type="text/javascript"></script>
<script src="../../../static/js/bootstrapValidator.min.js" type="text/javascript"></script>
<script type="text/javascript">
$(document).ready(function() {
$('#layer-pop').css("height","50%");
$("input").change(function(){
$('#inform').html("");
});
$('#reset_form').bootstrapValidator({
live:'submitted',
message: 'This value is not valid',
feedbackIcons: {
valid: 'glyphicon glyphicon-ok',
invalid: 'glyphicon glyphicon-remove',
validating: 'glyphicon glyphicon-refresh'
},
submitHandler: function (valiadtor, loginForm, submitButton) {
valiadtor.defaultSubmit();
},
fields: {
email: {
validators: {
notEmpty: {
message: '邮件不能为空'
},
emailAddress: {
message: '请输入正确的邮件地址'
}
}
}
}
});
});
</script>
</body>
</html>

View File

@ -0,0 +1,133 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta property="twitter:card" content="summary_large_image">
<meta property="twitter:site" content="@pratikborsadiya">
<meta property="twitter:creator" content="@pratikborsadiya">
<title>登录</title>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" type="text/css" href="../../../static/css/main.css">
<link rel="stylesheet" type="text/css" href="../../../static/css/bootstrap.css">
<link href="../../../static/css/customValidator.css" rel="stylesheet">
<link rel="stylesheet" type="text/css" href="../../../static/css/font-awesome.css">
<link rel="stylesheet" type="text/css" href="../../../static/css/login.css">
<style>
.form-group{
margin-top: 25px;
}
</style>
</head>
<body>
<header class="app-header">
<a class="app-header__logo" href="#">项目审核系统</a>
<ul class="app-nav">
<li><a class="app-nav__item" href="{% url 'user:login' %}">登录</a></li>
<li><a class="app-nav__item" href="{% url 'user:register' %}">注册</a></li>
</ul>
</header>
<main>
<!--弹出层窗体-->
<div class="layer-mask"></div>
<div id="layer-pop" class="layer-pop">
<!--弹出层内容区域-->
<div id="forHtml" class="layer-content">
<div class="col-md-10 col-md-offset-1">
<div class="passFor">
<h2 style="text-align: center">重置密码</h2>
<form id="reset_form" method="post" action="{{ uuid }}">
{% csrf_token %}
<div class="form-group">
<label class="control-label">新密码</label>
<div class="input-group">
<span class="input-group-addon"><span class="glyphicon glyphicon-eye-open"></span></span>
<input id="formGroupPassword" name="password" class="form-control required" type="password" placeholder="请输入新密码" />
</div>
</div>
<div class="form-group">
<label class="control-label">确认密码</label>
<div class="input-group">
<span class="input-group-addon"><span class="glyphicon glyphicon-lock"></span></span>
<input id="formGroupRepassword" name="password-retry" class="form-control required" type="password" placeholder="请再次输入新密码" />
</div>
</div>
{% if msg %}
<div class="form-group" style="margin-top: 20px">
<p id='inform' style="font-size: 15px;color:#c82333">{{ msg }}</p>
</div>
{% endif %}
<div class="form-group">
<input id="reset_formButton1" name='forBtn' class="btn btn-primary" type="submit" style="width:230px;display:block;margin:0 auto;" value="确认修改" />
</div>
</form>
</div>
</div>
</div>
</div>
</main>
<script src="../../../static/js/jquery-3.3.1.min.js" type="text/javascript"></script>
<script src="../../../static/js/bootstrap.min.js" type="text/javascript"></script>
<script src="../../../static/js/zh_CN.js" type="text/javascript"></script>
<script src="../../../static/js/bootstrapValidator.min.js" type="text/javascript"></script>
<script type="text/javascript">
$(document).ready(function() {
$('#layer-pop').css("height","65%");
$("input").change(function(){
$('#inform').html("");
});
$('#reset_form').bootstrapValidator({
live:'submitted',
message: 'This value is not valid',
feedbackIcons: {
valid: 'glyphicon glyphicon-ok',
invalid: 'glyphicon glyphicon-remove',
validating: 'glyphicon glyphicon-refresh'
},
submitHandler: function (valiadtor, loginForm, submitButton) {
valiadtor.defaultSubmit();
},
fields: {
password: {
validators: {
notEmpty: {
message: '密码不能为空'
},
stringLength: {
min: 6,
max: 16,
message: '密码长度必须在6到16之间'
},
regexp: {
regexp: /^[a-zA-Z0-9_]+$/,
message: '密码只能由字母、数字和下划线组成'
}
}
},
"password-retry": {
message: 'rePassword register error',
validators: {
notEmpty: {
message: '确认密码不能为空'
},
stringLength: {
min: 6,
max: 16,
message: '密码长度必须在6到16之间'
},
identical: {
field: 'password4',
message: '两次密码不一致'
},
regexp: {
regexp: /^[a-zA-Z0-9_]+$/,
message: '密码只能由字母、数字和下划线组成'
}
}
}
}
});
});
</script>
</body>
</html>

View File

@ -0,0 +1,66 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta property="twitter:card" content="summary_large_image">
<meta property="twitter:site" content="@pratikborsadiya">
<meta property="twitter:creator" content="@pratikborsadiya">
<title>登录</title>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" type="text/css" href="../../../static/css/main.css">
<link rel="stylesheet" type="text/css" href="../../../static/css/bootstrap.min.css">
<link href="../../../static/css/customValidator.css" rel="stylesheet">
<link rel="stylesheet" type="text/css" href="../../../static/css/font-awesome.css">
<link rel="stylesheet" type="text/css" href="../../../static/css/login.css">
<style>
p{
margin-top: 40px;
font-size: larger;
line-height: 35px;
}
button{
margin:0 auto;
}
</style>
</head>
<body>
<header class="app-header">
<a class="app-header__logo" href="#">项目审核系统</a>
<ul class="app-nav">
<li><a class="app-nav__item" href="{% url 'user:login' %}">登录</a></li>
<li><a class="app-nav__item" href="{% url 'user:register' %}">注册</a></li>
</ul>
</header>
<main>
<!--弹出层窗体-->
<div id="layer-pop" class="layer-pop">
<!--弹出层内容区域-->
<div id="forHtml" class="layer-content">
<div class="col-md-10 col-md-offset-1" style="margin:0 auto">
<p>尊敬的用户:<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;您好,欢迎再次使用“威海项目提交系统”。<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;我们刚刚已经发送一封邮件到您关联账号的邮箱之中,请及时查看,按照要求进行修改密码接下来的相关操作。<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;谢谢合作。</p>
<div style="text-align: center;">
<button class="btn btn-primary" id="last">返回上一步</button>
</div>
</div>
</div>
</div>
</main>
<script src="../../../static/js/jquery-3.3.1.min.js" type="text/javascript"></script>
<script src="../../../static/js/bootstrap.min.js" type="text/javascript"></script>
<script src="../../../static/js/zh_CN.js" type="text/javascript"></script>
<script src="../../../static/js/bootstrapValidator.min.js" type="text/javascript"></script>
<script type="text/javascript">
$(document).ready(function() {
$('#layer-pop').css("height", "55%");
$('#layer-pop').css("width", "60%");
$('#last').click(function(){
window.location.href="{% url 'user:ForgetPassword' %}";
})
});
</script>
</body>
</html>

View File

@ -0,0 +1,84 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta property="twitter:card" content="summary_large_image">
<meta property="twitter:site" content="@pratikborsadiya">
<meta property="twitter:creator" content="@pratikborsadiya">
<title>登录</title>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" type="text/css" href="../../../static/css/main.css">
<link rel="stylesheet" type="text/css" href="../../../static/css/bootstrap.min.css">
<link href="../../../static/css/customValidator.css" rel="stylesheet">
<link rel="stylesheet" type="text/css" href="../../../static/css/font-awesome.css">
<link rel="stylesheet" type="text/css" href="../../../static/css/login.css">
<style>
p{
margin-top: 55px;
font-size: 18px;
line-height: 35px;
}
button{
margin:0 auto;
}
span{
font-size: 20px;
color: #c82333;
}
.jump{
font-size: 20px;
text-decoration-line: underline;
}
</style>
</head>
<body>
<header class="app-header" style="background-color: #721c24;">
<a class="app-header__logo" href="#" style="background-color: #491217;">项目审核系统</a>
<ul class="app-nav">
<li><a class="app-nav__item" href="{% url 'user:login' %}">登录</a></li>
<li><a class="app-nav__item" href="{% url 'user:register' %}">注册</a></li>
</ul>
</header>
<main>
<!--弹出层窗体-->
<div class="layer-mask"></div>
<div id="layer-pop" class="layer-pop">
<!--弹出层内容区域-->
<div id="jumpHtml" class="layer-content">
<div class="col-md-10 col-md-offset-1" style="margin:0 auto">
<p>尊敬的用户:<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;恭喜,您的“威海项目提交系统”账号密码已经修改成功,接下来就可以登录系统进行相关操作了。<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;再次感谢您的使用。</p>
<div style="text-align: center;margin-top: 30px">
<span id="num">8</span><span>秒后将自动跳转到</span><a class='jump' href="{% url 'user:index' %}">登陆界面</a>
</div>
</div>
</div>
</div>
</main>
<script src="../../../static/js/jquery-3.3.1.min.js" type="text/javascript"></script>
<script src="../../../static/js/bootstrap.min.js" type="text/javascript"></script>
<script src="../../../static/js/zh_CN.js" type="text/javascript"></script>
<script src="../../../static/js/bootstrapValidator.min.js" type="text/javascript"></script>
<script type="text/javascript">
$(document).ready(function() {
$('#layer-pop').css("height", "55%");
$('#layer-pop').css("width", "60%");
setTimeout(function(){
window.location.href="{% url 'user:login' %}"
},8000)
setInterval(function(){
var num=$('#num').html();
if(num>0){
num=num-1;
$('#num').html(num);
}
else {
return;
}
},1000)
});
</script>
</body>
</html>

View File

@ -0,0 +1,29 @@
<!--{% extends 'base.html' %}-->
<!--{% load static %}-->
<!--{% block title %}User{% endblock %}-->
<!--{% block basecss %}-->
<!--{# 全部页面样式 #}-->
<!--<link rel="stylesheet" href="{% static 'user/css/base.css' %}">-->
<!--<link rel="stylesheet" href="../../../static/css/bootstrap.min.css">-->
<!--<link rel="stylesheet" href="../../../static/css/main.css">-->
<!--{% block css %}{% endblock %}-->
<!--{% endblock %}-->
<!--{% block basebody %}-->
<!--<header class="app-header" style="background-color: #721c24;">-->
<!--<a class="app-header__logo" href="#" style="background-color: #491217;">项目审核系统</a>-->
<!--<ul class="app-nav">-->
<!--<li><a class="app-nav__item" href="login.html">登录</a></li>-->
<!--<li><a class="app-nav__item" href="register.html">注册</a></li>-->
<!--</ul>-->
<!--</header>-->
<!--<main>-->
<!--<div id="layer-pop" class="layer-pop">-->
<!--{% block main %}{% endblock %}-->
<!--</div>-->
<!--</main>-->
<!--{% endblock %}-->
<!--{% block basejs %}-->
<!--<script src="{% static 'user/js/base.js' %}"></script>-->
<!--{% block js %}-->
<!--{% endblock %}-->
<!--{% endblock %}-->

View File

@ -0,0 +1,151 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta property="twitter:card" content="summary_large_image">
<meta property="twitter:site" content="@pratikborsadiya">
<meta property="twitter:creator" content="@pratikborsadiya">
<title>项目申报管理系统主页</title>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- Main CSS-->
<link rel="stylesheet" type="text/css" href="../../../static/css/main.css">
<link rel="stylesheet" type="text/css" href="../../../static/css/bootstrap.min.css">
<link rel="stylesheet" type="text/css" href="../../../static/css/login.css">
<!-- Font-icon css-->
<link href="../../../static/css/customValidator.css" rel="stylesheet">
<link rel="stylesheet" type="text/css" href="../../../static/css/font-awesome.css">
<style rel="stylesheet" type="text/css">
.wrapper {
display: flex;
justify-content: center;
}
.cta {
display: flex;
padding: 10px 45px;
text-decoration: none;
font-family: 'Poppins', sans-serif;
font-size: 40px;
color: white;
background-color: #721c24;
transition: 1s;
box-shadow: 6px 6px 0 black;
-webkit-transform: skewX(-15deg);
transform: skewX(-15deg);
position: fixed;
top:50%;
left: 50%;
margin-top: -40px;
margin-left: -150px;
z-index: 10005;
}
.cta:focus {
outline: none;
}
.cta:hover {
transition: 0.5s;
box-shadow: 10px 10px 0 #000000;
color:#FFFFFF;
text-decoration-line: none;
font-weight: bold;
}
.cta span:nth-child(2) {
transition: 0.5s;
margin-right: 0px;
}
.cta:hover span:nth-child(2) {
transition: 0.5s;
margin-right: 45px;
}
span {
-webkit-transform: skewX(15deg);
transform: skewX(15deg)
}
span:nth-child(2) {
width: 20px;
margin-left: 30px;
position: relative;
top: 12%;
}
path.one {
transition: 0.4s;
-webkit-transform: translateX(-60%);
transform: translateX(-60%);
}
path.two {
transition: 0.5s;
-webkit-transform: translateX(-30%);
transform: translateX(-30%);
}
.cta:hover path.three {
-webkit-animation: color_anim 1s infinite 0.2s;
animation: color_anim 1s infinite 0.2s;
}
.cta:hover path.one {
-webkit-transform: translateX(0%);
transform: translateX(0%);
-webkit-animation: color_anim 1s infinite 0.6s;
animation: color_anim 1s infinite 0.6s;
}
.cta:hover path.two {
-webkit-transform: translateX(0%);
transform: translateX(0%);
-webkit-animation: color_anim 1s infinite 0.4s;
animation: color_anim 1s infinite 0.4s;
}
@-webkit-keyframes color_anim {
0% {
fill: white;
}
50% {
fill: #000000;
}
100% {
fill: white;
}
}
@keyframes color_anim {
0% {
fill: white;
}
50% {
fill: #000000;
}
100% {
fill: white;
}
}
</style>
</head>
<body>
<header class="app-header" style="background-color: #721c24;">
<a class="app-header__logo" href="#" style="background-color: #491217;">项目审核系统</a>
<ul class="app-nav">
<li><a class="app-nav__item" href="{% url 'user:login' %}">登录</a></li>
<li><a class="app-nav__item" href={% url 'user:register' %}>注册</a></li>
</ul>
</header>
<main>
<div class="layer-mask"></div>
<div class="wrapper" style="text-align: center">
<a class="cta" href="{% url 'applyProject:applyProject' %}">
<span>申请项目</span>
<span>
<svg width="66px" height="43px" viewBox="0 0 66 43" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<g id="arrow" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
<path class="one" d="M40.1543933,3.89485454 L43.9763149,0.139296592 C44.1708311,-0.0518420739 44.4826329,-0.0518571125 44.6771675,0.139262789 L65.6916134,20.7848311 C66.0855801,21.1718824 66.0911863,21.8050225 65.704135,22.1989893 C65.7000188,22.2031791 65.6958657,22.2073326 65.6916762,22.2114492 L44.677098,42.8607841 C44.4825957,43.0519059 44.1708242,43.0519358 43.9762853,42.8608513 L40.1545186,39.1069479 C39.9575152,38.9134427 39.9546793,38.5968729 40.1481845,38.3998695 C40.1502893,38.3977268 40.1524132,38.395603 40.1545562,38.3934985 L56.9937789,21.8567812 C57.1908028,21.6632968 57.193672,21.3467273 57.0001876,21.1497035 C56.9980647,21.1475418 56.9959223,21.1453995 56.9937605,21.1432767 L40.1545208,4.60825197 C39.9574869,4.41477773 39.9546013,4.09820839 40.1480756,3.90117456 C40.1501626,3.89904911 40.1522686,3.89694235 40.1543933,3.89485454 Z" fill="#FFFFFF"></path>
<path class="two" d="M20.1543933,3.89485454 L23.9763149,0.139296592 C24.1708311,-0.0518420739 24.4826329,-0.0518571125 24.6771675,0.139262789 L45.6916134,20.7848311 C46.0855801,21.1718824 46.0911863,21.8050225 45.704135,22.1989893 C45.7000188,22.2031791 45.6958657,22.2073326 45.6916762,22.2114492 L24.677098,42.8607841 C24.4825957,43.0519059 24.1708242,43.0519358 23.9762853,42.8608513 L20.1545186,39.1069479 C19.9575152,38.9134427 19.9546793,38.5968729 20.1481845,38.3998695 C20.1502893,38.3977268 20.1524132,38.395603 20.1545562,38.3934985 L36.9937789,21.8567812 C37.1908028,21.6632968 37.193672,21.3467273 37.0001876,21.1497035 C36.9980647,21.1475418 36.9959223,21.1453995 36.9937605,21.1432767 L20.1545208,4.60825197 C19.9574869,4.41477773 19.9546013,4.09820839 20.1480756,3.90117456 C20.1501626,3.89904911 20.1522686,3.89694235 20.1543933,3.89485454 Z" fill="#FFFFFF"></path>
<path class="three" d="M0.154393339,3.89485454 L3.97631488,0.139296592 C4.17083111,-0.0518420739 4.48263286,-0.0518571125 4.67716753,0.139262789 L25.6916134,20.7848311 C26.0855801,21.1718824 26.0911863,21.8050225 25.704135,22.1989893 C25.7000188,22.2031791 25.6958657,22.2073326 25.6916762,22.2114492 L4.67709797,42.8607841 C4.48259567,43.0519059 4.17082418,43.0519358 3.97628526,42.8608513 L0.154518591,39.1069479 C-0.0424848215,38.9134427 -0.0453206733,38.5968729 0.148184538,38.3998695 C0.150289256,38.3977268 0.152413239,38.395603 0.154556228,38.3934985 L16.9937789,21.8567812 C17.1908028,21.6632968 17.193672,21.3467273 17.0001876,21.1497035 C16.9980647,21.1475418 16.9959223,21.1453995 16.9937605,21.1432767 L0.15452076,4.60825197 C-0.0425130651,4.41477773 -0.0453986756,4.09820839 0.148075568,3.90117456 C0.150162624,3.89904911 0.152268631,3.89694235 0.154393339,3.89485454 Z" fill="#FFFFFF"></path>
</g></svg>
</span>
</a>
</div>
</main>
<script src="../../../static/js/jquery-3.3.1.min.js"></script>
<script src="../../../static/js/bootstrap.min.js"></script>
<script src="../../../static/js/bootstrap3.min.js"></script>
<script src="../../../static/js/main.js"></script>
<!-- The javascript plugin to display page loading on top-->
<script src="../../../static/js/plugins/pace.min.js"></script>
</body>
</html>

View File

@ -0,0 +1,119 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta property="twitter:card" content="summary_large_image">
<meta property="twitter:site" content="@pratikborsadiya">
<meta property="twitter:creator" content="@pratikborsadiya">
<title>登录</title>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" type="text/css" href="../../../static/css/main.css">
<link rel="stylesheet" href="../../../static/css/customValidator.css">
<link rel="stylesheet" type="text/css" href="../../../static/css/font-awesome.css">
<link rel="stylesheet" type="text/css" href="../../../static/css/bootstrap.css">
<link rel="stylesheet" type="text/css" href="../../../static/css/login.css">
</head>
<body>
<header class="app-header">
<a class="app-header__logo" href="#">项目审核系统</a>
<ul class="app-nav">
<li><a class="app-nav__item" href="{% url 'user:login' %}">登录</a></li>
<li><a class="app-nav__item" href="{% url 'user:register' %}">注册</a></li>
</ul>
</header>
<main>
<div id="layer-pop" class="layer-pop">
<div><h1 class="title">登录</h1></div>
<div id="loginHtml" class="layer-content">
<div class="col-lg-10 col-lg-offset-1">
<div class="login">
<form id="loginForm" method="post" action="{% url 'user:login' %}">
{% csrf_token %}
<div class="form-group">
<label class="control-label">账号</label>
<div class="input-group">
<span class="input-group-addon"><span class="glyphicon glyphicon-user"></span></span>
<input id="formGroupUsername" name="username" class="form-control" type="text" required="required" placeholder="请输入账号" />
</div>
</div>
<div class="form-group">
<label class="control-label">密码</label>
<div class="input-group">
<span class="input-group-addon"><span class="glyphicon glyphicon-eye-open"></span></span>
<input id="formGroupPassword" name="password" class="form-control" type="password" required="required" placeholder="请输入密码" />
</div>
</div>
{% if msg %}
<div class="form-group row offset-3">
<p id='inform' style="font-size: 15px;color:#b11f1f">{{ msg }}</p>
</div>
{% endif %}
<div class="form-group">
<button id="user_formButton1" name='loginBtn' class="btn btn-primary" type='submit' style="width:300px;display:block;margin:10px auto">登录</button>
</div>
<div class="psd">
<span style="float:left"><input type="checkbox" value="rep" id="checkrep"/> 记住密码</span>
<span style="float:left">|</span>
<span style="float:left;padding-top: 2px"><a id='id="user_formButton2"' href="{% url 'user:ForgetPassword' %}">忘记密码</a></span>
<span style="float:right;padding-top: 2px"><a href="{% url 'user:register' %}">去注册!</a></span>
</div>
</form>
</div>
</div>
</div>
</div>
</main>
<script src="../../../static/js/jquery-3.3.1.min.js" type="text/javascript"></script>
<script src="../../../static/js/bootstrap.min.js" type="text/javascript"></script>
<script src="../../../static/js/zh_CN.js" type="text/javascript"></script>
<script src="../../../static/js/bootstrapValidator.min.js" type="text/javascript"></script>
<script src="../../../static/js/validate.js"></script>
<script src="../../../static/js/tableInit.js"></script>
<script src="../../../static/js/popper.min.js"></script>
<script type="text/javascript">
$(document).ready(function() {
$('#layer-pop').css("height","70%");
$("input").change(function(){
$('#inform').html("");
});
$("#loginForm").bootstrapValidator({
live: 'submitted',
message: 'This value is not valid',
submitButtons:'#user_formButton1',
feedbackIcons: {
valid: 'glyphicon glyphicon-ok',
invalid: 'glyphicon glyphicon-remove',
validating: 'glyphicon glyphicon-refresh'
},
submitHandler: function (valiadtor, loginForm, submitButton) {
valiadtor.defaultSubmit();
},
fields: {
username: {
message: 'username login error',
validators: {
notEmpty: {
message: '用户名不能为空'
},
stringLength: {
min: 1,
max: 150,
message: '用户名长度不能超过150'
}
}
},
password: {
message: 'password login error',
validators: {
notEmpty: {
message: '密码不能为空'
}
}
}
}}
);
});
</script>
</body>
</html>

View File

@ -0,0 +1,156 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta property="twitter:card" content="summary_large_image">
<meta property="twitter:site" content="@pratikborsadiya">
<meta property="twitter:creator" content="@pratikborsadiya">
<title>登录</title>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" type="text/css" href="../../../static/css/main.css">
<link rel="stylesheet" type="text/css" href="../../../static/css/bootstrap.css">
<link href="../../../static/css/customValidator.css" rel="stylesheet">
<link rel="stylesheet" type="text/css" href="../../../static/css/font-awesome.css">
<link rel="stylesheet" type="text/css" href="../../../static/css/login.css">
</head>
<body>
<header class="app-header">
<a class="app-header__logo" href="#">项目审核系统</a>
<ul class="app-nav">
<li><a class="app-nav__item" href="{% url 'user:logout' %}"><i class="glyphicon glyphicon-off" style="font-size: larger" title="注销"></i></a></li>
</ul>
</header>
<main>
<div id="layer-pop" class="layer-pop">
<div><h1 class="title">修改密码</h1></div>
<div id="loginHtml" class="layer-content">
<div class="col-lg-10 col-lg-offset-1">
<form id="change-form" method="post" action="{% url 'user:resetpassword' %}">
{% csrf_token %}
<div class="form-group">
<label class="control-label">账号</label>
<div class="input-group">
<span class="input-group-addon"><span class="glyphicon glyphicon-user"></span></span>
<input id="username" name="username" class="form-control" type="text" required="required" placeholder="请输入账号" />
</div>
</div>
<div class="form-group">
<label class="control-label">旧密码</label>
<div class="input-group">
<span class="input-group-addon"><span class="glyphicon glyphicon-eye-open"></span></span>
<input id="old-password" name="old-password" class="form-control" type="password" required="required" placeholder="请输入旧密码" />
</div>
</div>
<div class="form-group">
<label class="control-label">新密码</label>
<div class="input-group">
<span class="input-group-addon"><span class="glyphicon glyphicon-lock"></span></span>
<input id="new-password" name="new-password" class="form-control" type="password" required="required" placeholder="请输入新密码" />
</div>
</div>
<div class="form-group">
<label class="control-label">确认密码</label>
<div class="input-group">
<span class="input-group-addon"><span class="glyphicon glyphicon-record"></span></span>
<input id="two-password" name="two-password" class="form-control" type="password" required="required" placeholder="请再次输入新密码" />
</div>
</div>
{% if msg %}
<div class="form-group row offset-3">
<p id='inform' style="font-size: 15px;color:#b11f1f">{{ msg }}</p>
</div>
{% endif %}
<div class="form-group">
<button id="changeBtn" name='changeBtn' class="btn btn-primary" type='submit' style="width:230px;display:block;margin:10px auto">确定修改</button>
<span id="tip" style="color:red"></span>
</div>
</form>
</div>
</div>
</div>
</div>
</main>
<script src="../../../static/js/jquery-3.3.1.min.js" type="text/javascript"></script>
<script src="../../../static/js/bootstrap.min.js" type="text/javascript"></script>
<script src="../../../static/js/zh_CN.js" type="text/javascript"></script>
<script src="../../../static/js/bootstrapValidator.min.js" type="text/javascript"></script>
<script type="text/javascript">
$(document).ready(function() {
$('#layer-pop').css("height","92%");
$("input").change(function(){
$('#inform').html("");
});
$("#change-form").bootstrapValidator({
live: 'submitted',
message: 'This value is not valid',
submitButtons:'#changeBtn',
feedbackIcons: {
valid: 'glyphicon glyphicon-ok',
invalid: 'glyphicon glyphicon-remove',
validating: 'glyphicon glyphicon-refresh'
},
submitHandler: function (valiadtor, loginForm, submitButton) {
valiadtor.defaultSubmit();
},
fields: {
username: {
message: 'username login error',
validators: {
notEmpty: {
message: '用户名不能为空'
}
}
},
"old-password": {
message: 'password login error',
validators: {
notEmpty: {
message: '密码不能为空'
}
}
},
"new-password": {
message: 'password register error',
validators: {
notEmpty: {
message: '密码不能为空'
},
stringLength: {
min: 6,
max: 16,
message: '密码长度必须在6到16之间'
},
regexp: {
regexp: /^[a-zA-Z0-9_]+$/,
message: '密码只能由字母、数字和下划线组成'
}
}
},
"two-password": {
message: 'rePassword register error',
validators: {
notEmpty: {
message: '确认密码不能为空'
},
stringLength: {
min: 6,
max: 16,
message: '密码长度必须在6到16之间'
},
identical: {
field: 'password',
message: '两次密码不一致'
},
regexp: {
regexp: /^[a-zA-Z0-9_]+$/,
message: '密码只能由字母、数字和下划线组成'
}
}
},
}}
);
});
</script>
</body>
</html>

3
User/tests.py Normal file
View File

@ -0,0 +1,3 @@
from django.test import TestCase
# Create your tests here.

12
User/urls.py Normal file
View File

@ -0,0 +1,12 @@
from django.urls import path,include
from .views import *
urlpatterns = [
path('', IndexView.as_view(), name='index'),
path('login/', LoginView.as_view(), name='login'),
path('logout/', LogoutView.as_view(), name='logout'),
path('resetpassword/', ResetPasswordView.as_view(), name='resetpassword'),
path('forgetPassword/',ForgetPasswordView.as_view(),name='ForgetPassword'),
path('forgetPassword/check/',ForgetPasswordCheckView.as_view(),name='ForgetPasswordCheck'),
path('forgetPassword/jump/',ForgetPasswordJumpView.as_view(),name='ForgetPasswordJump'),
path('forgetPassword/active/<int:uuid>',ForgetPasswordToCreateView.as_view(),name='ForgetPasswordActive'),
]

140
User/views.py Normal file
View File

@ -0,0 +1,140 @@
import re
import uuid
import hashlib
from smtplib import SMTP_SSL
from email.header import Header
from email.mime.text import MIMEText
import datetime
from django.contrib.auth import authenticate, login, logout
from django.contrib.auth.mixins import LoginRequiredMixin
from django.contrib.auth.models import User
from django.shortcuts import render, redirect,HttpResponse
from django.views.generic import View
from django.conf import settings
from django.core.mail import send_mail, send_mass_mail
from django.contrib.auth.models import Group
class IndexView(View):
def get(self, request):
return render(request, 'user/index.html')
def post(self, request):
pass
class LoginView(View):
def get(self, request):
next = request.GET.get('next','')
return render(request, 'user/login.html', {
'next': next,
})
def post(self, request):
next = request.GET.get('next', '/user/')
user_name = request.POST.get('username')
pass_word = request.POST.get('password')
try:
user_account = User.objects.get(username=user_name)
except Exception as e:
user_account = None
user = authenticate(request, username=user_name, password=pass_word)
if user is not None:
login(request, user)
try:
group = Group.objects.get(user=user)
if group.name == "规划部" or group.name == "网络管理科" or group.name == "数据应用科":
return redirect('examineProject:TotalFirstExaminingProject')
except:
pass
return redirect(next)
else:
if not user_account:
return render(request, 'user/login.html', {
'msg': '用户不存在!请注册!',
})
return render(request, 'user/login.html', {
'msg': '密码错误!',
})
class LogoutView(View):
def get(self, request):
logout(request)
return redirect('/user/')
class ResetPasswordView(View):
def get(self, request):
return render(request, 'user/resetpassword.html')
def post(self, request):
username = request.user.username
password_old = request.POST.get('password-old')
password_new = request.POST.get('password')
password_retry = request.POST.get('password-retry')
url = request.POST.get('url', '/user/')
user = authenticate(username=username, password=password_old)
if user:
return render(request, 'user/resetpassword.html', {
'msg': '密码错误!'
})
else:
if password_new != password_retry:
return render(request, 'user/resetpassword.html', {
'msg': '两次输入的密码不一致!'
})
else:
user = User.objects.get(username=username)
user.set_password(password_retry)
user.save()
return redirect(url)
class ForgetPasswordView(View):
def get(self, request):
return render(request, 'user/ForgetPassword.html')
def post(self, request):
email = request.POST.get('email')
title = "威海项目提交系统修改密码的邮件"
user = User.objects.get(email=email)
url='/user/forgetPassword/active/'+str(user.id)
msg = f'以下为忘记密码后设置新密码所用连接,请点击连接!\n{settings.HOST}{url}\n如非本人操作,请忽视!'
email_from = settings.DEFAULT_FROM_EMAIL
reciever = [email]
send_mail(title, msg, email_from, reciever)
return render(request,'user/ForgetPasswordCheck.html')
class ForgetPasswordCheckView(View):
def get(self,request):
return render(request,'user/ForgetPasswordCheck.html')
def POST(self,request):
return redirect('/user/')
class ForgetPasswordToCreateView(View):
def get(self,request,uuid):
return render(request,'user/ForgetPasswordActive.html',{
'uuid':uuid
})
def post(self,request,uuid):
password = request.POST.get('password')
password_retry = request.POST.get('password-retry')
user = User.objects.get(id=uuid)
if not all([password, password_retry]):
return render(request, 'user/ForgetPasswordActive.html', {
'msg': '所填信息不能为空!'
})
if not password == password_retry:
return render(request, 'user/ForgetPasswordActive.html', {
'msg': '两次输入的密码不一致!'
})
user.set_password(password_retry)
user.save()
return render(request,'user/ForgetPasswordJump.html')
class ForgetPasswordJumpView(View):
def get(self,request):
return render(request,'user/ForgetPasswordJump.html')
def post(self,request):
pass

0
VideoDisplay/__init__.py Normal file
View File

Binary file not shown.

Binary file not shown.

Binary file not shown.

Some files were not shown because too many files have changed in this diff Show More