From 700648112154f3ebbeb50e2f20a794abc895de38 Mon Sep 17 00:00:00 2001 From: kongfp Date: Fri, 26 May 2023 16:27:22 +0800 Subject: [PATCH] init django project --- .gitignore | 23 ++++ TP_Admin/__init__.py | 0 TP_Admin/__pycache__/__init__.cpython-37.pyc | Bin 0 -> 128 bytes TP_Admin/__pycache__/settings.cpython-37.pyc | Bin 0 -> 2404 bytes TP_Admin/__pycache__/urls.cpython-37.pyc | Bin 0 -> 904 bytes TP_Admin/__pycache__/wsgi.cpython-37.pyc | Bin 0 -> 533 bytes TP_Admin/asgi.py | 16 +++ TP_Admin/settings.py | 127 ++++++++++++++++++ TP_Admin/urls.py | 21 +++ TP_Admin/wsgi.py | 16 +++ app/__init__.py | 0 app/__pycache__/__init__.cpython-37.pyc | Bin 0 -> 123 bytes app/__pycache__/admin.cpython-37.pyc | Bin 0 -> 164 bytes app/__pycache__/apps.cpython-37.pyc | Bin 0 -> 379 bytes app/__pycache__/models.cpython-37.pyc | Bin 0 -> 161 bytes app/admin.py | 3 + app/apps.py | 6 + app/migrations/__init__.py | 0 .../__pycache__/__init__.cpython-37.pyc | Bin 0 -> 134 bytes app/models.py | 3 + app/tests.py | 3 + app/views.py | 3 + manage.py | 22 +++ 23 files changed, 243 insertions(+) create mode 100644 .gitignore create mode 100644 TP_Admin/__init__.py create mode 100644 TP_Admin/__pycache__/__init__.cpython-37.pyc create mode 100644 TP_Admin/__pycache__/settings.cpython-37.pyc create mode 100644 TP_Admin/__pycache__/urls.cpython-37.pyc create mode 100644 TP_Admin/__pycache__/wsgi.cpython-37.pyc create mode 100644 TP_Admin/asgi.py create mode 100644 TP_Admin/settings.py create mode 100644 TP_Admin/urls.py create mode 100644 TP_Admin/wsgi.py create mode 100644 app/__init__.py create mode 100644 app/__pycache__/__init__.cpython-37.pyc create mode 100644 app/__pycache__/admin.cpython-37.pyc create mode 100644 app/__pycache__/apps.cpython-37.pyc create mode 100644 app/__pycache__/models.cpython-37.pyc create mode 100644 app/admin.py create mode 100644 app/apps.py create mode 100644 app/migrations/__init__.py create mode 100644 app/migrations/__pycache__/__init__.cpython-37.pyc create mode 100644 app/models.py create mode 100644 app/tests.py create mode 100644 app/views.py create mode 100644 manage.py diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..403adbc --- /dev/null +++ b/.gitignore @@ -0,0 +1,23 @@ +.DS_Store +node_modules +/dist + + +# local env files +.env.local +.env.*.local + +# Log files +npm-debug.log* +yarn-debug.log* +yarn-error.log* +pnpm-debug.log* + +# Editor directories and files +.idea +.vscode +*.suo +*.ntvs* +*.njsproj +*.sln +*.sw? diff --git a/TP_Admin/__init__.py b/TP_Admin/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/TP_Admin/__pycache__/__init__.cpython-37.pyc b/TP_Admin/__pycache__/__init__.cpython-37.pyc new file mode 100644 index 0000000000000000000000000000000000000000..5b2bc4ad5bf13683186e3115dc1627a7ecd94fd5 GIT binary patch literal 128 zcmZ?b<>g`kf?e|YDIoeWh=2h`Aj1KOi&=m~3PUi1CZpd%44L~m{fqEx>S+FG-VkBV$bw+x?3A$p^B_VN zaOK`EH4LB}6Q7e?WVzGzqyhg6DlA9S$8wawy}He|Wkj z%L8;oXdu0{oFQTV$5%iOryTu-Nsub0BcWySez-HHfqIPeh5^}xXYXFy57sx`E!*s` zt@r(7x4b^QQ+DpZ-C(fw?e>PbxwUn?cF#ZAzO&Z1x1Z?Yl@W;C^F1EWuAFchUY?Z> z(ci5ZVQfM?&QAt}h1X{m8DR`bKD*%Jf@Pz{%~=bM$I^=rgM};BU?5{>vN9M{eD9Fj z;pSN1r2q~&wgMt2`=iYU@Z??JlPk&Jf2gwH zP_E$cl9J;o)$N&BETnTf4h7$lN!m*ibINdb6BF{LjrT`{PFa2Rkxe+X_xi}{y~gU0 zf7lHymox`)6|gD0!ldxzVc@W^G=|~C9XMEfau@B12b0o}t4SH^<7E~tOf;FXk|f7F zZesoPFhD8cok7d0+c(91PYJI8*-vi zmpWElOD{(neh_|lUZj2MQFrLpiD&cvsr~oowI9`3YaHV#z_arLG=?q-Xzwh-Jn=S% z%$V!wl`vPrPX-oSDZD+##S?LTAP$pvsEx(w?^5DGqqrJnO%p!`rWs`ic;z~@8)T5% zC}*1SMHR~f!hGi~iNpckNFFzGJBp^p*%9S6wbE8~^M(3jG+$MBI(tz;sn?qaYSoMn zON*9j4NXT83NWR#D8FB;R_p44(pICzcC)FQop!y_Z0tr0y1L)0E4r#h%Lm$CE!MBs zDoUJv(LzN6zX(QGE literal 0 HcmV?d00001 diff --git a/TP_Admin/__pycache__/urls.cpython-37.pyc b/TP_Admin/__pycache__/urls.cpython-37.pyc new file mode 100644 index 0000000000000000000000000000000000000000..86d2b0eff77e9d234838db04ae446b3014819cf7 GIT binary patch literal 904 zcma)5O>WdM6m~M{w4^N@0dG(y(vU#eMFml+R#ZZ$g0dM^N#-rE{wgZ$cr{M}5 zC0kZpffdi5M2wJ-YAM#U^M1bXd(W>94`T%D$3sO&BZPjs!?56tUczUdz(&yw(SU|^ zAi`M~ID1r&L^O*6#3CB8aJ{o0e+!qvY?to5N9mY+3=z7zEKjK55`TF22A?Xq;LBDM z%ax4ds};jHt*#qlEz{E6;F=qYwQ4OhF2G=`@F&hbn+%^TjfK(-bGcAj_!PLQ88HkS z#)=rjT3OqeBG0L+Oh(s4E>)w|npHNdl*pOPpJhk6RSmC9?woTdZ}Rx;3lWgZ6!Cd0 zD~E1V)+c?M;S)+Rk(i4{XfFSq=UdVfzD2y8KgP$0XSB+0brwNipj zu_S^$Pn?~k@o7zrc{~SVbSvxsP$;`%+5ySDPy?LTkjtaLBO2$Q5mUM(lk^`%7qY5b z%Hw13tfDmNc8D80Fe0b;*Ren5Z_~YQw=7{k%5rwUhXhQl=5r0>in{$RoZ7vB zE;8J*E^@%T{jFwxNBSQ8_uKDBXT|m9X4K5}F!X;77o0V>-QKZKw5{2T2M}q-utmW^ Ha4`AJrM-nxnh?jhv`)Yd1rw0f)p#wV)hsK;`MKsP za!ZeWg+58qwWqv7Pu1F(WI&@C4fB29jE=UpViN549?JWOkiT`Zwq^)EhhyIbC&`$| zNKze*qi{DgEgIuSL?D_sA2wuDZv3PnYuu6XrldpC*}VM|e;@YxEJHI@Ih$g|MrZs` z7Rs=)!Z~CviQ~Rwa9yGW%iIjuszYckerRCAGQkRzmm1z`Sb$~=QK@Cghyo;=Ohj2~ zl?kWNOeO*EB+wLC0aGS07Rv%d6Tp>aQ>EbzvjFkTxzZk_sl?1CaxP4cYfTvzDVX#_ z@;;s6mBUm*sqv-&leXzg`ilMs&ReBV literal 0 HcmV?d00001 diff --git a/TP_Admin/asgi.py b/TP_Admin/asgi.py new file mode 100644 index 0000000..499eb58 --- /dev/null +++ b/TP_Admin/asgi.py @@ -0,0 +1,16 @@ +""" +ASGI config for TP_Admin 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.2/howto/deployment/asgi/ +""" + +import os + +from django.core.asgi import get_asgi_application + +os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'TP_Admin.settings') + +application = get_asgi_application() diff --git a/TP_Admin/settings.py b/TP_Admin/settings.py new file mode 100644 index 0000000..3b12108 --- /dev/null +++ b/TP_Admin/settings.py @@ -0,0 +1,127 @@ +""" +Django settings for TP_Admin project. + +Generated by 'django-admin startproject' using Django 3.2.19. + +For more information on this file, see +https://docs.djangoproject.com/en/3.2/topics/settings/ + +For the full list of settings and their values, see +https://docs.djangoproject.com/en/3.2/ref/settings/ +""" + +from pathlib import Path + +# 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/3.2/howto/deployment/checklist/ + +# SECURITY WARNING: keep the secret key used in production secret! +SECRET_KEY = 'django-insecure-d@xkg+%-m3g_h!%howm1%u#1l*v&sd3=7&_-33w!(oy7#!hg79' + +# 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', + 'app.apps.AppConfig', +] + +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 = 'TP_Admin.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 = 'TP_Admin.wsgi.application' + + +# Database +# https://docs.djangoproject.com/en/3.2/ref/settings/#databases + +DATABASES = { + 'default': { + 'ENGINE': 'django.db.backends.sqlite3', + 'NAME': BASE_DIR / 'db.sqlite3', + } +} + + +# Password validation +# https://docs.djangoproject.com/en/3.2/ref/settings/#auth-password-validators + +AUTH_PASSWORD_VALIDATORS = [ + { + 'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator', + }, + { + 'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator', + }, + { + 'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator', + }, + { + 'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator', + }, +] + + +# Internationalization +# https://docs.djangoproject.com/en/3.2/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.2/howto/static-files/ + +STATIC_URL = '/static/' + +# Default primary key field type +# https://docs.djangoproject.com/en/3.2/ref/settings/#default-auto-field + +DEFAULT_AUTO_FIELD = 'django.db.models.BigAutoField' diff --git a/TP_Admin/urls.py b/TP_Admin/urls.py new file mode 100644 index 0000000..b28a1c7 --- /dev/null +++ b/TP_Admin/urls.py @@ -0,0 +1,21 @@ +"""TP_Admin URL Configuration + +The `urlpatterns` list routes URLs to views. For more information please see: + https://docs.djangoproject.com/en/3.2/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 + +urlpatterns = [ + path('admin/', admin.site.urls), +] diff --git a/TP_Admin/wsgi.py b/TP_Admin/wsgi.py new file mode 100644 index 0000000..1ea9980 --- /dev/null +++ b/TP_Admin/wsgi.py @@ -0,0 +1,16 @@ +""" +WSGI config for TP_Admin 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.2/howto/deployment/wsgi/ +""" + +import os + +from django.core.wsgi import get_wsgi_application + +os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'TP_Admin.settings') + +application = get_wsgi_application() diff --git a/app/__init__.py b/app/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/app/__pycache__/__init__.cpython-37.pyc b/app/__pycache__/__init__.cpython-37.pyc new file mode 100644 index 0000000000000000000000000000000000000000..4cab7099ff085b1b8c7a244e67f93cc309e7f639 GIT binary patch literal 123 zcmZ?b<>g`kg5C1@DIoeWh=2h`Aj1KOi&=m~3PUi1CZpd2KczG$)efZlGY~TX0Pg7;fdBvi literal 0 HcmV?d00001 diff --git a/app/__pycache__/admin.cpython-37.pyc b/app/__pycache__/admin.cpython-37.pyc new file mode 100644 index 0000000000000000000000000000000000000000..49d1dbee5467087598099ea187240968c1689f04 GIT binary patch literal 164 zcmZ?b<>g`kg5C1@DNaE8F^B^LOhASM5Elyoi4=wu#vF!R#wbQch7_h?22JLdKv4!w z##^k3DY=<>ews{Cd?{IpdFlCj$@zIDMVU!OAOlu16fpxSF!4*#)hZ^SC_gJTxuiHI lBp}`qq%$V5pdbcphF(GCEe@O9{FKt1R69nXuFpWs007;pCC&f< literal 0 HcmV?d00001 diff --git a/app/__pycache__/apps.cpython-37.pyc b/app/__pycache__/apps.cpython-37.pyc new file mode 100644 index 0000000000000000000000000000000000000000..c8b0412e1f482cf2e1f54cb1c3e5b8949a1ef066 GIT binary patch literal 379 zcmYLFy-ve05Vm7iN=v&SRz%k^tZZ#A1u2+H@Bflsu1|2PRpvP89W1Ry{)sc1?mc_0t~`yjv+eP<~J z{z#(H4`z{wx^dDpx2Dd^V(UF8p-7gf_5wi>tRiUuG-VK^92j=sZGfS-OW4V}FflyG zl>wz~yef;N@63IvG&m-kW*v=OC`2tQC4`#@fr-8Ld@96CFZD5U4l0+u?u5j0kq`CU z$G%8A##saW&hHl4rZqdY?QHh65eZafo#7a-Hf~;rz5F$-hmdkQc-B$i&W_9a%)$BJ U_rUylU3h(1@Wvm(`d?1jAJ{}$$N&HU literal 0 HcmV?d00001 diff --git a/app/__pycache__/models.cpython-37.pyc b/app/__pycache__/models.cpython-37.pyc new file mode 100644 index 0000000000000000000000000000000000000000..a3b3001212835d69d61308835edbb10922ef5a73 GIT binary patch literal 161 zcmZ?b<>g`kg5C1@DKVR>67$mY^-_|GK$=%F6tMs)F!4*t)hZ^SC_gJTxuiHIBp}`~ hB{wrKCb6I(2BKfDpz;=n4Uk=$lWNBZ)b<&O831&qB@zGt literal 0 HcmV?d00001 diff --git a/app/admin.py b/app/admin.py new file mode 100644 index 0000000..8c38f3f --- /dev/null +++ b/app/admin.py @@ -0,0 +1,3 @@ +from django.contrib import admin + +# Register your models here. diff --git a/app/apps.py b/app/apps.py new file mode 100644 index 0000000..ed327d2 --- /dev/null +++ b/app/apps.py @@ -0,0 +1,6 @@ +from django.apps import AppConfig + + +class AppConfig(AppConfig): + default_auto_field = 'django.db.models.BigAutoField' + name = 'app' diff --git a/app/migrations/__init__.py b/app/migrations/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/app/migrations/__pycache__/__init__.cpython-37.pyc b/app/migrations/__pycache__/__init__.cpython-37.pyc new file mode 100644 index 0000000000000000000000000000000000000000..5ea9750e86c7073dcf9eeea03d23fddc874004a5 GIT binary patch literal 134 zcmZ?b<>g`kg5C1@DIoeWh=2h`Aj1KOi&=m~3PUi1CZpd