Compare commits
6 Commits
| Author | SHA1 | Date |
|---|---|---|
|
|
062bb581a7 | 1 year ago |
|
|
c10ac88cff | 1 year ago |
|
|
46d37377c9 | 1 year ago |
|
|
c03f8d7888 | 1 year ago |
|
|
6a377f92e0 | 1 year ago |
|
|
d9892785e0 | 1 year ago |
28 changed files with 388 additions and 0 deletions
@ -0,0 +1,81 @@ |
|||
<?xml version="1.0" encoding="UTF-8"?> |
|||
<project version="4"> |
|||
<component name="AutoImportSettings"> |
|||
<option name="autoReloadType" value="SELECTIVE" /> |
|||
</component> |
|||
<component name="ChangeListManager"> |
|||
<list default="true" id="d6d1ad46-9766-4e9e-bb7a-789562c8c333" name="更改" comment=""> |
|||
<change afterPath="$PROJECT_DIR$/django_instance/.idea/.gitignore" afterDir="false" /> |
|||
<change afterPath="$PROJECT_DIR$/django_instance/.idea/django_instance.iml" afterDir="false" /> |
|||
<change afterPath="$PROJECT_DIR$/django_instance/.idea/inspectionProfiles/Project_Default.xml" afterDir="false" /> |
|||
<change afterPath="$PROJECT_DIR$/django_instance/.idea/inspectionProfiles/profiles_settings.xml" afterDir="false" /> |
|||
<change afterPath="$PROJECT_DIR$/django_instance/.idea/misc.xml" afterDir="false" /> |
|||
<change afterPath="$PROJECT_DIR$/django_instance/.idea/modules.xml" afterDir="false" /> |
|||
<change afterPath="$PROJECT_DIR$/django_instance/db.sqlite3" afterDir="false" /> |
|||
<change afterPath="$PROJECT_DIR$/django_instance/django_instance/__init__.py" afterDir="false" /> |
|||
<change afterPath="$PROJECT_DIR$/django_instance/django_instance/asgi.py" afterDir="false" /> |
|||
<change afterPath="$PROJECT_DIR$/django_instance/django_instance/settings.py" afterDir="false" /> |
|||
<change afterPath="$PROJECT_DIR$/django_instance/django_instance/urls.py" afterDir="false" /> |
|||
<change afterPath="$PROJECT_DIR$/django_instance/django_instance/wsgi.py" afterDir="false" /> |
|||
<change afterPath="$PROJECT_DIR$/django_instance/function1/__init__.py" afterDir="false" /> |
|||
<change afterPath="$PROJECT_DIR$/django_instance/function1/admin.py" afterDir="false" /> |
|||
<change afterPath="$PROJECT_DIR$/django_instance/function1/apps.py" afterDir="false" /> |
|||
<change afterPath="$PROJECT_DIR$/django_instance/function1/migrations/__init__.py" afterDir="false" /> |
|||
<change afterPath="$PROJECT_DIR$/django_instance/function1/models.py" afterDir="false" /> |
|||
<change afterPath="$PROJECT_DIR$/django_instance/function1/tests.py" afterDir="false" /> |
|||
<change afterPath="$PROJECT_DIR$/django_instance/function1/views.py" afterDir="false" /> |
|||
<change afterPath="$PROJECT_DIR$/django_instance/manage.py" afterDir="false" /> |
|||
</list> |
|||
<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="Git.Settings"> |
|||
<option name="RECENT_GIT_ROOT_PATH" value="$PROJECT_DIR$" /> |
|||
</component> |
|||
<component name="ProjectColorInfo"><![CDATA[{ |
|||
"customColor": "", |
|||
"associatedIndex": 1 |
|||
}]]></component> |
|||
<component name="ProjectId" id="2nT1irqtBosZFKwFrfi9YkbdwJ9" /> |
|||
<component name="ProjectViewState"> |
|||
<option name="hideEmptyMiddlePackages" value="true" /> |
|||
<option name="showLibraryContents" value="true" /> |
|||
</component> |
|||
<component name="PropertiesComponent"><![CDATA[{ |
|||
"keyToString": { |
|||
"RunOnceActivity.ShowReadmeOnStart": "true", |
|||
"git-widget-placeholder": "master", |
|||
"node.js.detected.package.eslint": "true", |
|||
"node.js.detected.package.tslint": "true", |
|||
"node.js.selected.package.eslint": "(autodetect)", |
|||
"node.js.selected.package.tslint": "(autodetect)", |
|||
"nodejs_package_manager_path": "npm", |
|||
"vue.rearranger.settings.migration": "true" |
|||
} |
|||
}]]></component> |
|||
<component name="SharedIndexes"> |
|||
<attachedChunks> |
|||
<set> |
|||
<option value="bundled-js-predefined-1d06a55b98c1-0b3e54e931b4-JavaScript-PY-241.18034.82" /> |
|||
<option value="bundled-python-sdk-975db3bf15a3-2767605e8bc2-com.jetbrains.pycharm.pro.sharedIndexes.bundled-PY-241.18034.82" /> |
|||
</set> |
|||
</attachedChunks> |
|||
</component> |
|||
<component name="SpellCheckerSettings" RuntimeDictionaries="0" Folders="0" CustomDictionaries="0" DefaultDictionary="应用程序级" UseSingleDictionary="true" transferred="true" /> |
|||
<component name="TaskManager"> |
|||
<task active="true" id="Default" summary="默认任务"> |
|||
<changelist id="d6d1ad46-9766-4e9e-bb7a-789562c8c333" name="更改" comment="" /> |
|||
<created>1728982382710</created> |
|||
<option name="number" value="Default" /> |
|||
<option name="presentableId" value="Default" /> |
|||
<updated>1728982382710</updated> |
|||
<workItem from="1728982384326" duration="453000" /> |
|||
</task> |
|||
<servers /> |
|||
</component> |
|||
<component name="TypeScriptGeneratedFilesManager"> |
|||
<option name="version" value="3" /> |
|||
</component> |
|||
</project> |
|||
@ -0,0 +1 @@ |
|||
*.xml text eol=lf |
|||
@ -0,0 +1,8 @@ |
|||
# 默认忽略的文件 |
|||
/shelf/ |
|||
/workspace.xml |
|||
# 基于编辑器的 HTTP 客户端请求 |
|||
/httpRequests/ |
|||
# Datasource local storage ignored files |
|||
/dataSources/ |
|||
/dataSources.local.xml |
|||
@ -0,0 +1,27 @@ |
|||
<?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="django_instance/settings.py" /> |
|||
<option name="manageScript" value="$MODULE_DIR$/manage.py" /> |
|||
<option name="environment" value="<map/>" /> |
|||
<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="PyDocumentationSettings"> |
|||
<option name="format" value="PLAIN" /> |
|||
<option name="myDocStringFormat" value="Plain" /> |
|||
</component> |
|||
<component name="TemplatesService"> |
|||
<option name="TEMPLATE_CONFIGURATION" value="Django" /> |
|||
</component> |
|||
</module> |
|||
@ -0,0 +1,6 @@ |
|||
<component name="InspectionProjectProfileManager"> |
|||
<profile version="1.0"> |
|||
<option name="myName" value="Project Default" /> |
|||
<inspection_tool class="Eslint" enabled="true" level="WARNING" enabled_by_default="true" /> |
|||
</profile> |
|||
</component> |
|||
@ -0,0 +1,6 @@ |
|||
<component name="InspectionProjectProfileManager"> |
|||
<settings> |
|||
<option name="USE_PROJECT_PROFILE" value="false" /> |
|||
<version value="1.0" /> |
|||
</settings> |
|||
</component> |
|||
@ -0,0 +1,7 @@ |
|||
<?xml version="1.0" encoding="UTF-8"?> |
|||
<project version="4"> |
|||
<component name="Black"> |
|||
<option name="sdkName" value="Python 3.12" /> |
|||
</component> |
|||
<component name="ProjectRootManager" version="2" project-jdk-name="Python 3.12" project-jdk-type="Python SDK" /> |
|||
</project> |
|||
@ -0,0 +1,8 @@ |
|||
<?xml version="1.0" encoding="UTF-8"?> |
|||
<project version="4"> |
|||
<component name="ProjectModuleManager"> |
|||
<modules> |
|||
<module fileurl="file://$PROJECT_DIR$/.idea/django_instance.iml" filepath="$PROJECT_DIR$/.idea/django_instance.iml" /> |
|||
</modules> |
|||
</component> |
|||
</project> |
|||
@ -0,0 +1,6 @@ |
|||
<?xml version="1.0" encoding="UTF-8"?> |
|||
<project version="4"> |
|||
<component name="VcsDirectoryMappings"> |
|||
<mapping directory="$PROJECT_DIR$/.." vcs="Git" /> |
|||
</component> |
|||
</project> |
|||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -0,0 +1,16 @@ |
|||
""" |
|||
ASGI config for django_instance 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.1/howto/deployment/asgi/ |
|||
""" |
|||
|
|||
import os |
|||
|
|||
from django.core.asgi import get_asgi_application |
|||
|
|||
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'django_instance.settings') |
|||
|
|||
application = get_asgi_application() |
|||
@ -0,0 +1,126 @@ |
|||
""" |
|||
Django settings for django_instance project. |
|||
|
|||
Generated by 'django-admin startproject' using Django 3.1.4. |
|||
|
|||
For more information on this file, see |
|||
https://docs.djangoproject.com/en/3.1/topics/settings/ |
|||
|
|||
For the full list of settings and their values, see |
|||
https://docs.djangoproject.com/en/3.1/ref/settings/ |
|||
""" |
|||
|
|||
from pathlib import Path |
|||
|
|||
# Build paths inside the project like this: BASE_DIR / 'subdir'. |
|||
BASE_DIR = Path(__file__).resolve().parent.parent |
|||
print(BASE_DIR) |
|||
# Django项目的绝对路径 D:\pythonproject\pythonProject\django_instance |
|||
|
|||
|
|||
# Quick-start development settings - unsuitable for production |
|||
# See https://docs.djangoproject.com/en/3.1/howto/deployment/checklist/ |
|||
|
|||
# SECURITY WARNING: keep the secret key used in production secret! |
|||
SECRET_KEY = 'f2c=wg+_8(^vc(pb22$g45jinq_z6jgva@93b$de5_a&ly32@+' |
|||
|
|||
# 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', |
|||
] |
|||
# 已安装的应用,如有自定义应用的话,需要在此注册,如果不注册,则无法使用 |
|||
|
|||
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 = 'django_instance.urls' |
|||
|
|||
TEMPLATES = [ |
|||
{ |
|||
'BACKEND': 'django.template.backends.django.DjangoTemplates', |
|||
'DIRS': [], |
|||
'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 = 'django_instance.wsgi.application' |
|||
|
|||
|
|||
# Database |
|||
# https://docs.djangoproject.com/en/3.1/ref/settings/#databases |
|||
|
|||
DATABASES = { |
|||
'default': { |
|||
'ENGINE': 'django.db.backends.sqlite3', |
|||
'NAME': BASE_DIR / 'db.sqlite3', |
|||
} |
|||
} |
|||
# 数据库引擎配置,默认为 db.sqlite3 |
|||
|
|||
|
|||
# Password validation |
|||
# https://docs.djangoproject.com/en/3.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/3.1/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.1/howto/static-files/ |
|||
|
|||
STATIC_URL = '/static/' |
|||
@ -0,0 +1,22 @@ |
|||
"""django_instance URL Configuration |
|||
|
|||
The `urlpatterns` list routes URLs to views. For more information please see: |
|||
https://docs.djangoproject.com/en/3.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 |
|||
from django.urls import path |
|||
|
|||
urlpatterns = [ |
|||
path('admin/', admin.site.urls),# 初始路由 |
|||
# 在浏览器中输入127.0.0.1:8000/admin时,先经过urls文件,找到对应路由(admin),再执行该路由对应的视图(admin.site.urls) |
|||
] |
|||
@ -0,0 +1,16 @@ |
|||
""" |
|||
WSGI config for django_instance 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.1/howto/deployment/wsgi/ |
|||
""" |
|||
|
|||
import os |
|||
|
|||
from django.core.wsgi import get_wsgi_application |
|||
|
|||
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'django_instance.settings') |
|||
|
|||
application = get_wsgi_application() |
|||
@ -0,0 +1,3 @@ |
|||
from django.contrib import admin |
|||
|
|||
# Register your models here. |
|||
@ -0,0 +1,6 @@ |
|||
from django.apps import AppConfig |
|||
|
|||
|
|||
class Function1Config(AppConfig): |
|||
default_auto_field = 'django.db.models.BigAutoField' |
|||
name = 'function1' |
|||
@ -0,0 +1,3 @@ |
|||
from django.db import models |
|||
|
|||
# Create your models here. |
|||
@ -0,0 +1,18 @@ |
|||
<!DOCTYPE html> |
|||
<html lang="en"> |
|||
<head> |
|||
<meta charset="UTF-8"> |
|||
<meta name="viewport" content="width=device-width, initial-scale=1.0"> |
|||
<title>Document</title> |
|||
<script> |
|||
alert('hello') |
|||
console.log('控制台') |
|||
document.write('在页面上') |
|||
console.log('add'); |
|||
|
|||
</script> |
|||
</head> |
|||
<body> |
|||
|
|||
</body> |
|||
</html> |
|||
@ -0,0 +1,3 @@ |
|||
from django.test import TestCase |
|||
|
|||
# Create your tests here. |
|||
@ -0,0 +1,3 @@ |
|||
from django.shortcuts import render |
|||
|
|||
# Create your views here. |
|||
@ -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', 'django_instance.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() |
|||
Loading…
Reference in new issue