Commit 23f314e3 by liuyingying

新版Hunter

parents
<?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="Hunter_ht/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$/templates" />
</list>
</option>
</component>
<component name="TestRunnerService">
<option name="PROJECT_TEST_RUNNER" value="Unittests" />
</component>
</module>
\ No newline at end of file
<?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="Python 3.7 (Hunter-ht)" project-jdk-type="Python SDK" />
</project>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/.idea/Hunter_ht.iml" filepath="$PROJECT_DIR$/.idea/Hunter_ht.iml" />
</modules>
</component>
</project>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ChangeListManager">
<list default="true" id="334f9b58-cc67-4c85-a688-563f9eed59f1" 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="FileEditorManager">
<leaf>
<file pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/Hunter_ht/settings.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="510">
<caret line="34" column="27" lean-forward="true" selection-start-line="34" selection-start-column="27" selection-end-line="34" selection-end-column="27" />
</state>
</provider>
</entry>
</file>
<file pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/hunter/models.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="439">
<caret line="62" column="12" selection-start-line="62" selection-start-column="4" selection-end-line="62" selection-end-column="12" />
<folding>
<element signature="e#2#30#0" expanded="true" />
</folding>
</state>
</provider>
</entry>
</file>
<file pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/hunter/admin.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="90">
<caret line="6" column="19" selection-start-line="6" selection-start-column="19" selection-end-line="6" selection-end-column="19" />
<folding>
<element signature="e#0#32#0" expanded="true" />
</folding>
</state>
</provider>
</entry>
</file>
<file pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/hunter/views.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="270">
<caret line="25" column="16" selection-start-line="25" selection-start-column="16" selection-end-line="25" selection-end-column="16" />
<folding>
<element signature="e#0#54#0" expanded="true" />
</folding>
</state>
</provider>
</entry>
</file>
<file pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/hunter/templates/hunter/user.html">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="120">
<caret line="8" column="10" selection-start-line="8" selection-start-column="10" selection-end-line="8" selection-end-column="10" />
</state>
</provider>
</entry>
</file>
<file pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/hunter/templates/hunter/article.html">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="105">
<caret line="7" column="13" lean-forward="true" selection-start-line="7" selection-start-column="13" selection-end-line="7" selection-end-column="13" />
</state>
</provider>
</entry>
</file>
<file pinned="false" current-in-tab="true">
<entry file="file://$PROJECT_DIR$/hunter/templates/hunter/index.html">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="216">
<caret line="64" column="8" selection-start-line="64" selection-start-column="8" selection-end-line="64" selection-end-column="8" />
</state>
</provider>
</entry>
</file>
<file pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/hunter/static/hunter/style.css">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="-1290">
<caret line="76" column="1" lean-forward="true" selection-start-line="76" selection-start-column="1" selection-end-line="76" selection-end-column="1" />
</state>
</provider>
</entry>
</file>
<file pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/hunter/urls.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="135">
<caret line="9" column="42" selection-start-line="9" selection-start-column="42" selection-end-line="9" selection-end-column="42" />
<folding>
<element signature="e#0#28#0" expanded="true" />
</folding>
</state>
</provider>
</entry>
</file>
</leaf>
</component>
<component name="FileTemplateManagerImpl">
<option name="RECENT_TEMPLATES">
<list>
<option value="Python Script" />
<option value="HTML File" />
<option value="CSS File" />
</list>
</option>
</component>
<component name="IdeDocumentHistory">
<option name="CHANGED_PATHS">
<list>
<option value="$PROJECT_DIR$/hunter/admin.py" />
<option value="$PROJECT_DIR$/Hunter_ht/urls.py" />
<option value="$PROJECT_DIR$/hunter/models.py" />
<option value="$PROJECT_DIR$/hunter/templates/hunter/article.html" />
<option value="$PROJECT_DIR$/hunter/templates/hunter/detail.html" />
<option value="$PROJECT_DIR$/hunter/templates/hunter/user.html" />
<option value="$PROJECT_DIR$/hunter/urls.py" />
<option value="$PROJECT_DIR$/Hunter_ht/settings.py" />
<option value="$PROJECT_DIR$/hunter/static/polls/style.css" />
<option value="$PROJECT_DIR$/hunter/static/hunter/style.html" />
<option value="$PROJECT_DIR$/hunter/static/hunter/style.css" />
<option value="$PROJECT_DIR$/hunter/views.py" />
<option value="$PROJECT_DIR$/hunter/templates/hunter/index.html" />
</list>
</option>
</component>
<component name="ProjectFrameBounds" fullScreen="true">
<option name="x" value="31" />
<option name="y" value="53" />
<option name="width" value="1392" />
<option name="height" value="797" />
</component>
<component name="ProjectView">
<navigator proportions="" version="1">
<foldersAlwaysOnTop value="true" />
</navigator>
<panes>
<pane id="Scope" />
<pane id="ProjectPane">
<subPane>
<expand>
<path>
<item name="Hunter_ht" type="b2602c69:ProjectViewProjectNode" />
<item name="Hunter_ht" type="462c0819:PsiDirectoryNode" />
</path>
<path>
<item name="Hunter_ht" type="b2602c69:ProjectViewProjectNode" />
<item name="Hunter_ht" type="462c0819:PsiDirectoryNode" />
<item name="hunter" type="462c0819:PsiDirectoryNode" />
</path>
<path>
<item name="Hunter_ht" type="b2602c69:ProjectViewProjectNode" />
<item name="Hunter_ht" type="462c0819:PsiDirectoryNode" />
<item name="hunter" type="462c0819:PsiDirectoryNode" />
<item name="migrations" type="462c0819:PsiDirectoryNode" />
</path>
<path>
<item name="Hunter_ht" type="b2602c69:ProjectViewProjectNode" />
<item name="Hunter_ht" type="462c0819:PsiDirectoryNode" />
<item name="hunter" type="462c0819:PsiDirectoryNode" />
<item name="static" type="462c0819:PsiDirectoryNode" />
</path>
<path>
<item name="Hunter_ht" type="b2602c69:ProjectViewProjectNode" />
<item name="Hunter_ht" type="462c0819:PsiDirectoryNode" />
<item name="hunter" type="462c0819:PsiDirectoryNode" />
<item name="static" type="462c0819:PsiDirectoryNode" />
<item name="hunter" type="462c0819:PsiDirectoryNode" />
</path>
<path>
<item name="Hunter_ht" type="b2602c69:ProjectViewProjectNode" />
<item name="Hunter_ht" type="462c0819:PsiDirectoryNode" />
<item name="hunter" type="462c0819:PsiDirectoryNode" />
<item name="templates" type="462c0819:PsiDirectoryNode" />
</path>
<path>
<item name="Hunter_ht" type="b2602c69:ProjectViewProjectNode" />
<item name="Hunter_ht" type="462c0819:PsiDirectoryNode" />
<item name="hunter" type="462c0819:PsiDirectoryNode" />
<item name="templates" type="462c0819:PsiDirectoryNode" />
<item name="hunter" type="462c0819:PsiDirectoryNode" />
</path>
<path>
<item name="Hunter_ht" type="b2602c69:ProjectViewProjectNode" />
<item name="Hunter_ht" type="462c0819:PsiDirectoryNode" />
<item name="Hunter_ht" type="462c0819:PsiDirectoryNode" />
</path>
</expand>
<select />
</subPane>
</pane>
</panes>
</component>
<component name="PropertiesComponent">
<property name="DefaultHtmlFileTemplate" value="HTML File" />
<property name="WebServerToolWindowFactoryState" value="false" />
<property name="list.type.of.created.stylesheet" value="CSS" />
<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="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="Hunter_ht" type="Python.DjangoServer" factoryName="Django server">
<module name="Hunter_ht" />
<option name="INTERPRETER_OPTIONS" value="" />
<option name="PARENT_ENVS" value="true" />
<envs>
<env name="PYTHONUNBUFFERED" value="1" />
<env name="DJANGO_SETTINGS_MODULE" value="Hunter_ht.settings" />
</envs>
<option name="SDK_HOME" value="" />
<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="334f9b58-cc67-4c85-a688-563f9eed59f1" name="Default Changelist" comment="" />
<created>1587005874771</created>
<option name="number" value="Default" />
<option name="presentableId" value="Default" />
<updated>1587005874771</updated>
<workItem from="1587005878056" duration="33238000" />
</task>
<servers />
</component>
<component name="TimeTrackingManager">
<option name="totallyTimeSpent" value="33238000" />
</component>
<component name="ToolWindowManager">
<frame x="722" y="0" width="718" height="900" extended-state="0" />
<editor active="true" />
<layout>
<window_info id="Favorites" order="0" side_tool="true" />
<window_info active="true" content_ui="combo" id="Project" order="1" sideWeight="0.49910232" visible="true" weight="0.16420119" />
<window_info id="Structure" order="2" sideWeight="0.50089765" side_tool="true" weight="0.16420119" />
<window_info anchor="bottom" id="Database Changes" order="0" />
<window_info anchor="bottom" id="Terminal" order="1" weight="0.32891566" />
<window_info anchor="bottom" id="Event Log" order="2" side_tool="true" />
<window_info anchor="bottom" id="Version Control" order="3" />
<window_info anchor="bottom" id="Python Console" order="4" weight="0.32891566" />
<window_info anchor="bottom" id="Docker" order="5" show_stripe_button="false" />
<window_info anchor="bottom" id="Message" order="6" />
<window_info anchor="bottom" id="Find" order="7" />
<window_info anchor="bottom" id="Run" order="8" visible="true" weight="0.27951807" />
<window_info anchor="bottom" id="Debug" order="9" weight="0.4" />
<window_info anchor="bottom" id="Cvs" order="10" weight="0.25" />
<window_info anchor="bottom" id="Inspection" order="11" weight="0.4" />
<window_info anchor="bottom" id="TODO" order="12" />
<window_info anchor="right" id="Database" order="0" />
<window_info anchor="right" id="Commander" internal_type="SLIDING" order="1" type="SLIDING" weight="0.4" />
<window_info anchor="right" id="SciView" order="2" />
<window_info anchor="right" id="Ant Build" order="3" weight="0.25" />
<window_info anchor="right" content_ui="combo" id="Hierarchy" order="4" weight="0.25" />
</layout>
</component>
<component name="TypeScriptGeneratedFilesManager">
<option name="version" value="1" />
</component>
<component name="editorHistoryManager">
<entry file="file://$PROJECT_DIR$/hunter/tests.py">
<provider selected="true" editor-type-id="text-editor" />
</entry>
<entry file="file://$PROJECT_DIR$/Hunter_ht/urls.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="285">
<caret line="19" column="37" selection-start-line="19" selection-start-column="37" selection-end-line="19" selection-end-column="37" />
<folding>
<element signature="e#633#665#0" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/hunter/templates/hunter/detail.html">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="90">
<caret line="6" column="6" selection-start-line="6" selection-start-column="6" selection-end-line="6" selection-end-column="6" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/hunter/admin.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="90">
<caret line="6" column="19" selection-start-line="6" selection-start-column="19" selection-end-line="6" selection-end-column="19" />
<folding>
<element signature="e#0#32#0" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/hunter/urls.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="135">
<caret line="9" column="42" selection-start-line="9" selection-start-column="42" selection-end-line="9" selection-end-column="42" />
<folding>
<element signature="e#0#28#0" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/hunter/static/hunter/style.html">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="60">
<caret line="4" column="16" selection-start-line="4" selection-start-column="11" selection-end-line="4" selection-end-column="16" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/hunter/static/polls/style.css">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="45">
<caret line="3" column="1" lean-forward="true" selection-end-line="3" selection-end-column="1" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/Hunter_ht/settings.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="510">
<caret line="34" column="27" lean-forward="true" selection-start-line="34" selection-start-column="27" selection-end-line="34" selection-end-column="27" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/hunter/static/hunter/style.css">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="-1290">
<caret line="76" column="1" lean-forward="true" selection-start-line="76" selection-start-column="1" selection-end-line="76" selection-end-column="1" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/hunter/models.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="439">
<caret line="62" column="12" selection-start-line="62" selection-start-column="4" selection-end-line="62" selection-end-column="12" />
<folding>
<element signature="e#2#30#0" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/hunter/templates/hunter/user.html">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="120">
<caret line="8" column="10" selection-start-line="8" selection-start-column="10" selection-end-line="8" selection-end-column="10" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/hunter/views.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="270">
<caret line="25" column="16" selection-start-line="25" selection-start-column="16" selection-end-line="25" selection-end-column="16" />
<folding>
<element signature="e#0#54#0" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/hunter/templates/hunter/article.html">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="105">
<caret line="7" column="13" lean-forward="true" selection-start-line="7" selection-start-column="13" selection-end-line="7" selection-end-column="13" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/hunter/templates/hunter/index.html">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="216">
<caret line="64" column="8" selection-start-line="64" selection-start-column="8" selection-end-line="64" selection-end-column="8" />
</state>
</provider>
</entry>
</component>
</project>
\ No newline at end of file
"""
ASGI config for Hunter_ht project.
It exposes the ASGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/3.0/howto/deployment/asgi/
"""
import os
from django.core.asgi import get_asgi_application
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'Hunter_ht.settings')
application = get_asgi_application()
"""
Django settings for Hunter_ht project.
Generated by 'django-admin startproject' using Django 3.0.4.
For more information on this file, see
https://docs.djangoproject.com/en/3.0/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/3.0/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/3.0/howto/deployment/checklist/
# SECURITY WARNING: keep the secret key used in production secret!
SECRET_KEY = '^20@&z2z0r&#3xbfy6m4y+p=5&d1n58g4ng03n2c=0)b@*=bu('
# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = True
ALLOWED_HOSTS = []
# Application definition
INSTALLED_APPS = [
'hunter.apps.HunterConfig',
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
]
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 = 'Hunter_ht.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 = 'Hunter_ht.wsgi.application'
# Database
# https://docs.djangoproject.com/en/3.0/ref/settings/#databases
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.mysql',
'NAME': 'HUNTER',
'USER': 'root',
'PASSWORD': 'mysql',
'HOST': '127.0.0.1',
'PORT': '3306',
}
}
# Password validation
# https://docs.djangoproject.com/en/3.0/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/3.0/topics/i18n/
LANGUAGE_CODE = 'en-us'
TIME_ZONE = 'UTC'
USE_I18N = True
USE_L10N = True
USE_TZ = True
# Static files (CSS, JavaScript, Images)
# https://docs.djangoproject.com/en/3.0/howto/static-files/
STATIC_URL = '/static/'
"""Hunter_ht URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/3.0/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
from django.urls import path, include
urlpatterns = [
path('', include('hunter.urls')),
path('admin/', admin.site.urls),
]
"""
WSGI config for Hunter_ht 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/3.0/howto/deployment/wsgi/
"""
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'Hunter_ht.settings')
application = get_wsgi_application()
from django.contrib import admin
from .models import *
# Register your models here.
admin.site.register(User)
admin.site.register(Publications)
admin.site.register(PubToUser)
admin.site.register(Articles)
admin.site.register(Bugs)
admin.site.register(ScoreRecords)
from django.apps import AppConfig
class HunterConfig(AppConfig):
name = 'hunter'
# Generated by Django 3.0.4 on 2020-04-16 06:20
from django.db import migrations, models
import django.utils.timezone
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='Articles',
fields=[
('articleID', models.BigIntegerField(primary_key=True, serialize=False)),
('authorID', models.IntegerField()),
('title', models.CharField(default='null', max_length=500)),
('content', models.TextField()),
('publish', models.CharField(default='0', max_length=5)),
('editDateTime', models.DateField(default=django.utils.timezone.now)),
('isPrivate', models.CharField(default='0', max_length=5)),
('attachment', models.CharField(default='nofile', max_length=1000)),
],
),
migrations.CreateModel(
name='Bugs',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('owner', models.CharField(max_length=50)),
('identifier', models.CharField(max_length=50)),
('bugType', models.CharField(max_length=20)),
('datetime', models.DateField(default=django.utils.timezone.now)),
('description', models.TextField()),
('url', models.CharField(max_length=1000)),
],
),
migrations.CreateModel(
name='Publications',
fields=[
('pubID', models.BigIntegerField(primary_key=True, serialize=False)),
('title', models.CharField(max_length=1000)),
('link', models.CharField(max_length=1000)),
('authors', models.CharField(max_length=1000)),
('messages', models.CharField(default='no information', max_length=100)),
('publishType', models.CharField(default=' ', max_length=100)),
('journalname', models.CharField(default=' ', max_length=1000)),
('date', models.DateField(default=django.utils.timezone.now)),
('indexType', models.CharField(default=' ', max_length=100)),
('uploadByUser', models.CharField(default='no records', max_length=50)),
('isOpen', models.CharField(default='1', max_length=5)),
],
),
migrations.CreateModel(
name='PubToUser',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('pubID', models.BigIntegerField()),
('username', models.CharField(max_length=50)),
],
),
migrations.CreateModel(
name='ScoreRecords',
fields=[
('recordID', models.BigIntegerField(primary_key=True, serialize=False)),
('userID', models.BigIntegerField()),
('username', models.CharField(default='null', max_length=50)),
('reason', models.TextField(default='no reason')),
('editDate', models.DateField(default=django.utils.timezone.now)),
],
),
migrations.CreateModel(
name='User',
fields=[
('userID', models.BigIntegerField(primary_key=True, serialize=False)),
('name', models.CharField(max_length=50)),
('pwd', models.CharField(max_length=100)),
('nake_name', models.CharField(max_length=100)),
('identity', models.CharField(default='0', max_length=1)),
('introduction', models.TextField(default='No Information')),
('score', models.IntegerField(default=0)),
('scoreUsed', models.IntegerField(default=0)),
],
),
]
from django.db import models
from django.utils import timezone
# Create your models here.
class User(models.Model):
userID = models.BigIntegerField(primary_key=True)
name = models.CharField(max_length=50)
pwd = models.CharField(max_length=100)
nake_name = models.CharField(max_length=100)
identity = models.CharField(max_length=1, default='0')
introduction = models.TextField(default="No Information")
score = models.IntegerField(default=0)
scoreUsed = models.IntegerField(default=0)
def is_admin(self):
return self.identity
class Publications(models.Model):
pubID = models.BigIntegerField(primary_key=True)
title = models.CharField(max_length=1000)
link = models.CharField(max_length=1000)
authors = models.CharField(max_length=1000)
messages = models.CharField(max_length=100, default='no information')
publishType = models.CharField(max_length=100,default=' ')
journalname=models.CharField(max_length=1000,default=' ')
date = models.DateField(default=timezone.now)
indexType = models.CharField(max_length=100,default=' ')
uploadByUser = models.CharField(max_length=50,default='no records')
isOpen = models.CharField(max_length=5, default='1')
class PubToUser(models.Model):
pubID = models.BigIntegerField()
username = models.CharField(max_length=50)
class Articles(models.Model):
articleID = models.BigIntegerField(primary_key=True)
authorID = models.IntegerField()
title = models.CharField(max_length=500, default='null')
content = models.TextField()
publish = models.CharField(max_length=5, default='0')
editDateTime = models.DateField(default=timezone.now)
isPrivate = models.CharField(max_length=5, default='0')
attachment = models.CharField(max_length=1000, default='nofile')
class ScoreRecords(models.Model):
recordID = models.BigIntegerField(primary_key=True)
userID = models.BigIntegerField()
username = models.CharField(max_length=50,default='null')
reason = models.TextField(default='no reason')
editDate = models.DateField(default=timezone.now)
class Bugs(models.Model):
owner = models.CharField(max_length=50)
identifier = models.CharField(max_length=50)
bugType = models.CharField(max_length=20)
datetime = models.DateField(default=timezone.now)
description = models.TextField()
url = models.CharField(max_length=1000)
*{
box-sizing:border-box;
transition:all .5s;
-moz-transition:all .5s;
-webkit-transition:all .5s;
-o-transition:all .5s;
margin:0;
padding: 0;
}
body{
background-color: #ffffff;
width:100%;
}
ul li{
list-style-type: none;
margin:0;
}
li a{
color: black;
text-decoration: none;
}
nav{
width:100%;
height:80px;
position: fixed;
/*border-bottom: solid 1px #e3e6e8;*/
background:white;
}
section{
width:100%;
padding:5px 30px;
min-height: 800px;
}
section > .box{
width:100%;
height:100px;
border-bottom: solid 1px #e3e6e8;
}
nav>div{
width:100%;
height:100%;
}
#hunter{
width:40%;
height:100%;
float: left;
position: relative;
}
#hunter>span{
font-family: "Bitstream Vera Sans Mono", Monaco, "Courier New", Courier, monospace;
font-size:38px;
font-weight: bold;
height:40px;
display: block;
position: absolute;
left:25px;
bottom:25px;
}
#bar{
width:60%;
height:100%;
float: left;
}
#bar>ul{
display: block;
width:100%;
height:30px;
}
#bar>ul>li{
width:auto;
float: right;
margin-right:25px;
}
.bottom>li>a:hover{
font-size:20px;
color: #095009;
border-bottom:solid 5px #eeeeee;
}
.top>li>a:hover{
font-size:16px;
color: #095009;
border-bottom:solid 3px #eeeeee;
}
#bar>.top{
font-size:14px;
margin-top:15px;
}
#bar>.top>li>a{
color:grey;
}
#bar>.bottom{
font-size: 18px;
color:black;
}
#welcome{
width:300px;
height:80px;
margin: 0 auto;
}
#welcome > span{
width:100%;
height:80px;
display: block;
padding-top:16px;
text-align: center;
vertical-align: middle;
font-family: monospace;
font-size:40px;
font-weight: bold;
font-style: italic;
/*border-top:solid 2px black;*/
/*border-bottom: solid 2px grey ;*/
}
.staff_tag{
width:100%;
height:40px;
padding-left:5%;
}
.staff_tag>span{
display: block;
width:33%;
height:40px;
font-size:18px;
font-weight: bold;
float: left;
}
.content>ul{
display: block;
width:100%;
padding-left: 8%;
}
.content>ul>li{
display: block;
width:33%;
height:30px;
float: left;
}
.wrap{
width:100%;
}
blockquote{
/*width:50px;*/
/*height:40px;*/
/*line-height: 40px;*/
/*padding:0 5px;*/
/*font-size:16px;*/
/*font-weight: bold;*/
/*display: block;*/
padding: 15.5px 15px;
margin: 20px 0 10px;
border-left: 5px solid #eee;
}
blockquote>p{
font-size: 20px;
font-weight: bold;
line-height: 1.25;
font-style: italic;
color: #095009;
}
.wrap>ul{
display: block;
width:100%;
}
.wrap>ul>li{
display: block;
height:40px;
line-height: 40px;
float:left;
margin-left:20px;
}
.wrap>ul:after{
content:".";
clear:both;
display:block;
height:0;
overflow:hidden;
visibility:hidden;
}
.big_text{
font-size: 16px;
font-style: italic;
}
.wrap>ul>li>a:hover{
color: #095009;
font-size:18px;
text-underline: #eeeeee;
}
.small_text{
font-size: 14px;
color:grey;
}
.middle_text{
font-size: 16px;
}
.right{
float:right !important;
margin-right:20px;
}
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>hunter.article</title>
</head>
<body>
{{ article }}
<p>article</p>
</body>
</html>
\ No newline at end of file
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>hunter.detail</title>
</head>
<body>
</body>
</html>
\ No newline at end of file
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>hunter.index</title>
{% load static %}
<link rel="stylesheet" type="text/css" href="{% static 'hunter/style.css' %}">
</head>
<body>
<nav>
<div>
<div id="hunter">
<span>HUNTER</span>
</div>
<div id="bar">
<ul class="top">
<li><a>登录</a></li>
</ul>
<ul class="bottom">
<li><a href="#article">文章随笔</a></li>
<li><a href="#cve">漏洞成果</a></li>
<li><a href="#project">项目研究</a></li>
<li><a href="#publish">出版物</a></li>
<li><a href="#">首页</a></li>
</ul>
</div>
</div>
</nav>
<section id="home">
<div class="box"></div>
<div id="welcome">
<span>
| Welcome |
</span>
</div>
<div class="staff_tag">
<span>Academic STAFF</span>
<span>Engineer STAFF</span>
<span>Student</span>
</div>
<div class="content">
{% if user_list %}
<ul>
{% for user in user_list %}
<li><a href="{% url 'hunter:user' user.userID %}">{{ user.name }}</a></li>
<li><a href="{% url 'hunter:user' user.userID %}">{{ user.name }}</a></li>
<li><a href="{% url 'hunter:user' user.userID %}">{{ user.name }}</a></li>
<li><a href="{% url 'hunter:user' user.userID %}">{{ user.name }}</a></li>
<li><a href="{% url 'hunter:user' user.userID %}">{{ user.name }}</a></li>
<li><a href="{% url 'hunter:user' user.userID %}">{{ user.name }}</a></li>
<li><a href="{% url 'hunter:user' user.userID %}">{{ user.name }}</a></li>
<li><a href="{% url 'hunter:user' user.userID %}">{{ user.name }}</a></li>
{% endfor %}
</ul>
{% endif %}
</div>
</section>
<section id="project">
<div class="box"></div>
<div>
</div>
</section>
<section id="publish">
<div class="box"></div>
<div class="wrap">
{% for year,publications in publication_year_list.items %}
<blockquote ><p>{{ year }}</p></blockquote>
{% if publications %}
{% for publication in publications %}
<ul>
<li class="big_text"><a href="{{ publication.link }}">{{ publication.title }}</a></li>
<li class="small_text">{{ publication.authors }}</li>
<li class="middle_text right">{{ publication.date }}</li>
</ul>
{% endfor %}
{% endif %}
{% endfor %}
</div>
</section>
<section id="cve">
<div class="box"></div>
<div class="wrap">
{% for year, cves in cve_year_list.items %}
<blockquote ><p>{{ year }}</p></blockquote>
{% if cves %}
<ul>
{% for cve in cves %}
<li class="big_text"><a href="{{ cve.url }}">{{ cve.identifier }}</a></li>
<li>{{ cve.bugType }}</li>
<li class="small_text">{{ cve.description }}</li>
<li class="middle_text right">{{ cve.datetime }}</li>
{% endfor %}
</ul>
{% endif %}
{% endfor %}
</div>
</section>
<section id="article">
<div class="box"></div>
{% if article_list %}
<ul>
{% for article in article_list %}
<li><a href="{% url 'hunter:article' article.articleID %}">{{ article.title }}</a></li>
<li>{{ article.author }}</li>
{% endfor %}
</ul>
{% endif %}
</section>
<section>
{% if bug_list %}
<ul>
{% for bug in bug_list %}
<li><a href="{{ bug.url }}">{{ bug.identifier }}</a></li>
{% endfor %}
</ul>
{% endif %}
</section>
</body>
</html>
\ No newline at end of file
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>hunter.user</title>
</head>
<body>
{{ user }}
</body>
</html>
\ No newline at end of file
from django.test import TestCase
# Create your tests here.
from django.urls import path
from . import views
app_name = 'hunter'
urlpatterns = [
path('', views.index, name='index'),
# path('<int:pk>/', views.UserDetail.as_view(), name='user'),
# path('<int:pk>/article/', views.ArticleDetail.as_view(), name='article'),
path('user/<int:user_id>/', views.user, name='user'),
path('article/<int:article_id>/', views.article, name='article'),
]
\ No newline at end of file
from django.shortcuts import render, get_object_or_404
from django.http import HttpResponse, Http404
from .models import *
from django.views import generic
from django.db.models.aggregates import Count
from django.db.models import Count
# Create your views here.
def index(request):
user_list = User.objects.values('userID', 'name')
publication_list = Publications.objects.order_by('-date')
publication_year_list = {}
for pub in publication_list:
year = str(pub.date)[0:4]
pub.date = str(pub.date)[5:10]
if year in publication_year_list.keys():
publication_year_list[year].append(pub)
else:
publication_year_list[year] = [pub]
bug_list = Bugs.objects.order_by('-datetime')
cve_year_list = {}
for cve in bug_list:
year = str(cve.datetime)[0:4]
cve.datetime = str(cve.datetime)[5:10]
print(cve.datetime)
if year in cve_year_list.keys():
cve_year_list[year].append(cve)
else:
cve_year_list[year] = [cve]
article_list = Articles.objects.order_by('-editDateTime')
context = {
'user_list': user_list,
'publication_year_list': publication_year_list,
'cve_year_list': cve_year_list,
'article_list': article_list,
}
return render(request, 'hunter/index.html', context)
def user(request, user_id):
u = get_object_or_404(User, pk=user_id)
return render(request, 'hunter/user.html', {'user': u})
def article(request, article_id):
art = get_object_or_404(Articles, pk=article_id)
return render(request, 'hunter/article.html', {'article': art})
#!/usr/bin/env python
"""Django's command-line utility for administrative tasks."""
import os
import sys
def main():
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'Hunter_ht.settings')
try:
from django.core.management import execute_from_command_line
except ImportError as exc:
raise ImportError(
"Couldn't import Django. Are you sure it's installed and "
"available on your PYTHONPATH environment variable? Did you "
"forget to activate a virtual environment?"
) from exc
execute_from_command_line(sys.argv)
if __name__ == '__main__':
main()
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment