From 21ab061a3feb5f3f3e61b6ef5c8ef5184bdbd0b9 Mon Sep 17 00:00:00 2001 From: BINGWU Date: Mon, 25 Mar 2024 22:51:20 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- serve/manage.py | 22 +++ serve/serve/__init__.py | 0 .../__pycache__/__init__.cpython-311.pyc | Bin 0 -> 224 bytes .../__pycache__/settings.cpython-311.pyc | Bin 0 -> 2693 bytes serve/serve/__pycache__/urls.cpython-311.pyc | Bin 0 -> 1211 bytes serve/serve/__pycache__/wsgi.cpython-311.pyc | Bin 0 -> 742 bytes serve/serve/asgi.py | 16 +++ .../models/__pycache__/user.cpython-311.pyc | Bin 0 -> 677 bytes serve/serve/settings.py | 128 ++++++++++++++++++ serve/serve/urls.py | 23 ++++ .../views/__pycache__/index.cpython-311.pyc | Bin 0 -> 451 bytes .../views/__pycache__/user.cpython-311.pyc | Bin 0 -> 1138 bytes serve/serve/wsgi.py | 16 +++ 13 files changed, 205 insertions(+) create mode 100644 serve/manage.py create mode 100644 serve/serve/__init__.py create mode 100644 serve/serve/__pycache__/__init__.cpython-311.pyc create mode 100644 serve/serve/__pycache__/settings.cpython-311.pyc create mode 100644 serve/serve/__pycache__/urls.cpython-311.pyc create mode 100644 serve/serve/__pycache__/wsgi.cpython-311.pyc create mode 100644 serve/serve/asgi.py create mode 100644 serve/serve/models/__pycache__/user.cpython-311.pyc create mode 100644 serve/serve/settings.py create mode 100644 serve/serve/urls.py create mode 100644 serve/serve/views/__pycache__/index.cpython-311.pyc create mode 100644 serve/serve/views/__pycache__/user.cpython-311.pyc create mode 100644 serve/serve/wsgi.py diff --git a/serve/manage.py b/serve/manage.py new file mode 100644 index 0000000..8327837 --- /dev/null +++ b/serve/manage.py @@ -0,0 +1,22 @@ +#!/usr/bin/env python +"""Django's command-line utility for administrative tasks.""" +import os +import sys + + +def main(): + """Run administrative tasks.""" + os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'serve.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() diff --git a/serve/serve/__init__.py b/serve/serve/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/serve/serve/__pycache__/__init__.cpython-311.pyc b/serve/serve/__pycache__/__init__.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..0309f0396084ba79a1648b993ee5f633bcd64699 GIT binary patch literal 224 zcmZ3^%ge<81pgWs(?IlN5CH>>P{wCAAY(d13PUi1CZpdyCGBvj#C%-Z^RW~y)Ex#x? zu_QA;Pd7I)FEKqeH#M(Bx45#nBsDjtIJKxO6-vg(XXa&=#K-FuRQ}?y$<0qG%}KQ@ aVg*_ca%C|;kodsN$jJDC0Y(%t1H}L@D@o=6 literal 0 HcmV?d00001 diff --git a/serve/serve/__pycache__/settings.cpython-311.pyc b/serve/serve/__pycache__/settings.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..76997abcc66d15a2ede2edd35b941557366194ab GIT binary patch literal 2693 zcmb7G&u`mQ9Dh#ICQX_&ZL_xffs`@Wma#f3T{kwtHn(xQXlYWCbOo!D<@miO&io_T z&PII7anm?(g98UZXafz6>rVRzxO7m7$)`#TF>aA2E}Zzp{d@^Yx6d z4-fq~{J?|IBX~L&g+Rwch8_UUBX~O3*FF3m!+k#h`e>I^^Y?~(BQAjb+z1YE!3yF+ z6@*8=rMOXe2jLyYAufVPNdSkf5JD9S2XF*rW8YE|g`;2jDik+{$GIq;z>~n4z%iE| za_N*rReanyp5`X-3^xfrV(=Wohq)Njwo{BdNz=(Gt7wB{JJXogz zQPFe~ms9{(1XI$~INWAc0(X*3&VoY{teR%sxSUL4O*H6^kKPJIO-T|p34lpct4pGh z>@7Fhfj6rpzS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BvK{{m6Yi@5** literal 0 HcmV?d00001 diff --git a/serve/serve/__pycache__/urls.cpython-311.pyc b/serve/serve/__pycache__/urls.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..6e1f1f256df9975b4ce1e0f136965b77bf7f28ee GIT binary patch literal 1211 zcmb7D&ubGw6rSB|(sWC!9twgUMhd12?XC*F1b-mbVxf3YdkKMbo1G*Zc4n5DNo~YK zkCk3L6g(HCRfKx&seeNXJ(QdTE7n_}c=6<$O%_r?(8uiT+nKlD``$Ni_QuC;1h%tj z)Rr;`ebpbSSp(->fb$LosDuI|Fe8JSCDYJ;CdyE&WF@{8WofRIGmwdh6=aFo97%zi z`PADr5&8sA-|9wb6ryuvbk~4&c=`r-x#!3k@n1uzz5HwmS2?SN^_K8e$QiD2fh7@Z z1jm9mNmaSF{h~qeN=rnsuM`nXuHYz?3Jcy+L}I{@SaG}-l9$rO3jjd5AUI@zMf<36 zM0`mAm=tXc)=(;zMb8U(Rk}gbXLX*Yt8(fQ=FPdcJjLU%Dm@+SL3-)gkJo()Sh8p@ zv{*GEoTN=aZ@c(m5MZC-kj7l7BE~hrDW>g;AIF2mKFuWl&LCb_pbHqP5PpSX8`Fit z%%H9Yr(^~*pOSk8?H3&TQRGWGy9$K`L#Tga!Bv9@O~g$Yr*xhG*8i~4@vbi`8f4n} zgV7?ZMy()Zbr2!Rr%Ti4o9eTe2!nwN9FLAA(+;i;q%8L3>K})z1y4y1VrLRj{+aD+ z#Oodim}V;Ig#@?YIQ9?SkB-sJ`T-3YIF?o%-uaM)Y8kS>$|YOgQ^)R(R4ULbl}dMF zKo6=?B3u=4u~2txh_ldFt9vEs;l9*v$O5u1vU=T;p(0&N7uOvdI`EI^9JbNV2&VaB zc_EBQ`Rw!I_YYfV`-f-yJLPZh_f8MqoE~hIUOMT|o2_;O; z%C=O5mJ?2cSu=3s_OJY1%7a!!?u*NiT3=JyhN+h^45MdWGOQlb6Gq034#LCZ1YPf3 z94F{z=i>Ncy9n$ZuXdLX*d6vXc%m0oi{8 Di;R57 literal 0 HcmV?d00001 diff --git a/serve/serve/__pycache__/wsgi.cpython-311.pyc b/serve/serve/__pycache__/wsgi.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..15766c3f1ac2e2b6644f1548cdb70de6a3543de4 GIT binary patch literal 742 zcmY*X&ubGw6n?X58{OIb0l-4XIRwJq4^7Z-wH;gE*TskiMCD^W)9D@B3!vU}nYyZU1&j{Vf6b zkxWK5aW%MX>cKnkpbQ@I3`WXC_bFxssd9<{lGbP^yq_E$9`C&gZ*t!NIMi)u1Ps8` zzMdS8mY_W486{Yp+WBTaFRd47P4K$kpmh;ZiBTJA7>O3vlx3O)Me$WABuc89NQc{9 z#@v?-sVk{V1L18k%ra~vqir|x2O;hT=+SD`4MXPFT;&U1t?GPh8Y2)9QlD$MU=W~! z>*T(qb)VrqO##iOQlVV7ZBNvs<+WVi5F<`C5!lG>2iB6^6x&MJ9)?VG0_4ixmJQ!F zex{-hOWOXMq&~8ao%I6Kan2ytq zqX{@pYzP_O9@4OCn!S}IjZzvWP9tyok>IhZ4|-U4x0s5j$M8PGWy0qV(=NYUS<@OT z{VylKKJE37PWne5DnCCSoFBhAKi;c^9n}>4S`dRo9Ab9tzOsSK-3BI#v$7)<29*Kz zE1z()!p`3tE5oOG7-clH{&FB+Xm^n!gj^VDGI0Tky931By_u9A-0xnmJuqII-(mJE l%y#Fj?$V=E$els13%OoqzMGjp%`BW{7IvqT65Z0t{{v3K>k0q> literal 0 HcmV?d00001 diff --git a/serve/serve/asgi.py b/serve/serve/asgi.py new file mode 100644 index 0000000..e3951c7 --- /dev/null +++ b/serve/serve/asgi.py @@ -0,0 +1,16 @@ +""" +ASGI config for serve 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/5.0/howto/deployment/asgi/ +""" + +import os + +from django.core.asgi import get_asgi_application + +os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'serve.settings') + +application = get_asgi_application() diff --git a/serve/serve/models/__pycache__/user.cpython-311.pyc b/serve/serve/models/__pycache__/user.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..0ab40215a48004a91e11676cfa8a6dc1629f80da GIT binary patch literal 677 zcmah{zfaph6n$X3JKRz8@oqo7F-3#l@bY026NECIhnuz6C zuBk*sX{=;fL^7(OK$(_xQ>Q3G({&R^Xog0vLp#aSdNZ--HUOLG7Y15)*QG!Aey8Kl zeVaY^D;IvH<5ybMdpBFvRyFZ+tCE}8UnBDt)M~@dG3@fl@&nPd$!@(@!}FU@W=v_n kmaZD;xrC5Qm^shy-h@M*_uyaHFLtJ%{IbOFd)PszKh8V1Pyhe` literal 0 HcmV?d00001 diff --git a/serve/serve/settings.py b/serve/serve/settings.py new file mode 100644 index 0000000..665101a --- /dev/null +++ b/serve/serve/settings.py @@ -0,0 +1,128 @@ +""" +Django settings for serve project. + +Generated by 'django-admin startproject' using Django 5.0.3. + +For more information on this file, see +https://docs.djangoproject.com/en/5.0/topics/settings/ + +For the full list of settings and their values, see +https://docs.djangoproject.com/en/5.0/ref/settings/ +""" + +from pathlib import Path +# 连接mongodb +import mongoengine +mongoengine.connect(db="employee-information-management-system", host="mongodb://localhost:27017/") + +# Build paths inside the project like this: BASE_DIR / 'subdir'. +BASE_DIR = Path(__file__).resolve().parent.parent + + +# Quick-start development settings - unsuitable for production +# See https://docs.djangoproject.com/en/5.0/howto/deployment/checklist/ + +# SECURITY WARNING: keep the secret key used in production secret! +SECRET_KEY = 'django-insecure-j@%fl_pfj5g316ra9)cdh5j_&4$_ctezibzy03i)9vey&er=jh' + +# SECURITY WARNING: don't run with debug turned on in production! +DEBUG = True + +ALLOWED_HOSTS = [] + + +# Application definition + +INSTALLED_APPS = [ + 'serve', + '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 = 'serve.urls' + +TEMPLATES = [ + { + 'BACKEND': 'django.template.backends.django.DjangoTemplates', + 'DIRS': [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 = 'serve.wsgi.application' + + +# Database +# https://docs.djangoproject.com/en/5.0/ref/settings/#databases + +# DATABASES = { +# 'default': { +# 'ENGINE': 'django.db.backends.sqlite3', +# 'NAME': BASE_DIR / 'db.sqlite3', +# } +# } + + +# Password validation +# https://docs.djangoproject.com/en/5.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/5.0/topics/i18n/ + +LANGUAGE_CODE = 'en-us' + +TIME_ZONE = 'UTC' + +USE_I18N = True + +USE_TZ = True + + +# Static files (CSS, JavaScript, Images) +# https://docs.djangoproject.com/en/5.0/howto/static-files/ + +STATIC_URL = 'static/' + +# Default primary key field type +# https://docs.djangoproject.com/en/5.0/ref/settings/#default-auto-field + +DEFAULT_AUTO_FIELD = 'django.db.models.BigAutoField' diff --git a/serve/serve/urls.py b/serve/serve/urls.py new file mode 100644 index 0000000..f4b2577 --- /dev/null +++ b/serve/serve/urls.py @@ -0,0 +1,23 @@ +""" +URL configuration for serve project. + +The `urlpatterns` list routes URLs to views. For more information please see: + https://docs.djangoproject.com/en/5.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 +from serve.views.index import initUrls +urlpatterns = [ + path('admin/', admin.site.urls), +] +initUrls(urlpatterns) diff --git a/serve/serve/views/__pycache__/index.cpython-311.pyc b/serve/serve/views/__pycache__/index.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..094097adbd896a94fda46388abc87a2344cb6096 GIT binary patch literal 451 zcmZXQze@u#6vtnBhn_!*9Yq~n96Gc(iinfA2wlXb9LQl(J-FnKB(0t(I5;SsrE@{3 zUFzDYe}iu2Rx8%6P+XjRIohH4l6>ELN#2K-w6fVnKx;mb3Pt~6lBs1T!FUye22h|R z08Yw;0L|P(IYX^u$lKrMTAL(JRWW&5mBAUA6dGqB7OwFcN&{{{qo3M!7T^}ah#@6u zuH{Lxgowz~nn|IQL2dph)Pr63&<~h9eC>U`)Q6qku+wxupId|OrV&;(X zCl6%?@MS*+5J7=5;T~M*ojJw!%jZL)XvrFarg0ib(6eo@^e0?GVB^~U* z#-(y7chI+2o_5~t^}8c8#<&Niyp`lqRxza%&38yslNPr@E|_>8<=5HcA*}{%UoK;6 a-l(=wMiwEY4_j}ub2LZD#t8mPO8f&S%ze%P literal 0 HcmV?d00001 diff --git a/serve/serve/views/__pycache__/user.cpython-311.pyc b/serve/serve/views/__pycache__/user.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..ae8895e63ab31d23047084b5b2c80b18987f8c65 GIT binary patch literal 1138 zcmZuw%}*0S6rbJBZa)^pj~FaqB*CO`paujq#CQ=57ddG3&@?d%JC@e{s54VYjV3*4 z!dC(@CU6rI1r3T;OBFgLu0^P57~wp7pRlawGSa1p@IyxEJSe z37lb`D>U0PEhg}oXXQm8ML3lVh@dx?A>*70eVh`L6Ds+Gqk@z?%Mr!}woGm^dGYP- ze<%z?gUP#Tna#33&4W_iYmlZ4tP$&sE+lPQ*z<;Jsl5jo6Fz9f1HQjpBE6sQ8K;P7;8 zK3>AnGL9B;v|=>P4=$$O+9ji-Y;+Wcb1EokyInq+Xt!3O=#H|(FSjHEB z;I{9$ZRP3aND;S{@NgLq7x8e#XkI>3GGb*TR>ZLbI0`*CWIERlQvsIGS{c(#d2u%3 zQ9hpIjLK(N<4>Hc)e?8)vuAOMtFcX+V1+P_fH`V2s!NQl>F{zNL+~@AQ5kIp^*3}2 zHp$uKHoXF_`~g@FR5hR|$~NjL{;zGLSkd3Mkx{69+o-MRZ&h7WI;-edokv=@Ff@I6 VIa0zMW!zB>s10f%B)?i({{a8IB1QlJ literal 0 HcmV?d00001 diff --git a/serve/serve/wsgi.py b/serve/serve/wsgi.py new file mode 100644 index 0000000..ec76e15 --- /dev/null +++ b/serve/serve/wsgi.py @@ -0,0 +1,16 @@ +""" +WSGI config for serve 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/5.0/howto/deployment/wsgi/ +""" + +import os + +from django.core.wsgi import get_wsgi_application + +os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'serve.settings') + +application = get_wsgi_application()