Commit f48514d3 by 周田

mod: release

parent eac543da
...@@ -3,3 +3,4 @@ __pycache__ ...@@ -3,3 +3,4 @@ __pycache__
.idea .idea
assets assets
*.tar *.tar
static
...@@ -757,4 +757,4 @@ testing = ["coverage (>=5.0.3)", "zope.event", "zope.testing"] ...@@ -757,4 +757,4 @@ testing = ["coverage (>=5.0.3)", "zope.event", "zope.testing"]
[metadata] [metadata]
lock-version = "2.0" lock-version = "2.0"
python-versions = "^3.9" python-versions = "^3.9"
content-hash = "f761714ff60db8e9ad08e4266a9bcf848b31c742a1f739f2add93363930fe3ce" content-hash = "dc39740cb0c5a8a0aaf331b94d4c7f16ae4196fd04e4dc5618b40f68d9b4d6c3"
...@@ -13,6 +13,7 @@ channels = {extras = ["daphne"], version = "^4.0.0"} ...@@ -13,6 +13,7 @@ channels = {extras = ["daphne"], version = "^4.0.0"}
drf-yasg = "^1.21.7" drf-yasg = "^1.21.7"
paho-mqtt = "^1.6.1" paho-mqtt = "^1.6.1"
protobuf = "3.20.1" protobuf = "3.20.1"
daphne = "^4.0.0"
[build-system] [build-system]
......
...@@ -23,7 +23,7 @@ BASE_DIR = Path(__file__).resolve().parent.parent ...@@ -23,7 +23,7 @@ BASE_DIR = Path(__file__).resolve().parent.parent
SECRET_KEY = 'django-insecure-68xzqkau2%ulw2t^tpfo0d8$+_8$5z2jixypnxv$#81l&0=)s0' SECRET_KEY = 'django-insecure-68xzqkau2%ulw2t^tpfo0d8$+_8$5z2jixypnxv$#81l&0=)s0'
# SECURITY WARNING: don't run with debug turned on in production! # SECURITY WARNING: don't run with debug turned on in production!
DEBUG = True DEBUG = False
ALLOWED_HOSTS = ['*'] ALLOWED_HOSTS = ['*']
...@@ -65,7 +65,8 @@ TEMPLATES = [ ...@@ -65,7 +65,8 @@ TEMPLATES = [
{ {
'BACKEND': 'django.template.backends.django.DjangoTemplates', 'BACKEND': 'django.template.backends.django.DjangoTemplates',
'DIRS': [ 'DIRS': [
os.path.join(BASE_DIR, 'frontend', 'dist') # os.path.join(BASE_DIR, 'frontend', 'dist')
os.path.join(BASE_DIR, 'static')
], ],
'APP_DIRS': True, 'APP_DIRS': True,
'OPTIONS': { 'OPTIONS': {
...@@ -129,11 +130,12 @@ USE_TZ = True ...@@ -129,11 +130,12 @@ USE_TZ = True
# Static files (CSS, JavaScript, Images) # Static files (CSS, JavaScript, Images)
# https://docs.djangoproject.com/en/3.2/howto/static-files/ # https://docs.djangoproject.com/en/3.2/howto/static-files/
STATIC_URL = '/assets/' STATIC_URL = '/static/'
STATIC_ROOT = os.path.join(BASE_DIR, 'assets') # STATIC_ROOT = os.path.join(BASE_DIR, 'static')
STATIC_ROOT = 'static'
STATICFILES_DIRS = [ STATICFILES_DIRS = [
os.path.join(BASE_DIR, 'frontend', 'dist', 'assets'), # os.path.join(BASE_DIR, 'frontend', 'dist'),
os.path.join(BASE_DIR, 'frontend', 'dist'), # os.path.join(BASE_DIR, 'static'),
] ]
...@@ -179,3 +181,16 @@ CORS_ALLOW_HEADERS = [ ...@@ -179,3 +181,16 @@ CORS_ALLOW_HEADERS = [
CORS_ALLOWED_ORIGINS = [ CORS_ALLOWED_ORIGINS = [
"http://127.0.0.1:5173", # 您的前端应用地址 "http://127.0.0.1:5173", # 您的前端应用地址
] ]
LOGGING = {
'version': 1,
'disable_existing_loggers': False,
'handlers': {
'console': {
'class': 'logging.StreamHandler',
},
},
'root': {
'handlers': ['console'],
'level': 'INFO',
},
}
...@@ -13,6 +13,7 @@ Including another URLconf ...@@ -13,6 +13,7 @@ Including another URLconf
1. Import the include() function: from django.urls import include, path 1. Import the include() function: from django.urls import include, path
2. Add a URL to urlpatterns: path('blog/', include('blog.urls')) 2. Add a URL to urlpatterns: path('blog/', include('blog.urls'))
""" """
import os
from django.contrib import admin from django.contrib import admin
from django.urls import path, include, re_path from django.urls import path, include, re_path
from .views import index, test, upload, download from .views import index, test, upload, download
...@@ -44,9 +45,9 @@ urlpatterns = [ ...@@ -44,9 +45,9 @@ urlpatterns = [
path("api/", include("device_communication.urls")), path("api/", include("device_communication.urls")),
path("api/", include("simulate_device_manager.urls")), path("api/", include("simulate_device_manager.urls")),
re_path(r'^assets/(?P<path>.*)/$', serve, {'document_root': settings.STATIC_ROOT}), # re_path(r'^static/(?P<path>.*)/$', serve, {'document_root': settings.STATIC_ROOT}, name='static'),
# re_path(r'^assets/(?P<path>.*)/$', serve, {'document_root': os.path.join(settings.STATIC_ROOT, 'assets')}, name='assets'),
re_path(r'^swagger/$', schema_view.with_ui('swagger', cache_timeout=0), name='schema-swagger-ui'), re_path(r'^swagger/$', schema_view.with_ui('swagger', cache_timeout=0), name='schema-swagger-ui'),
re_path(r'^[a-zA-Z]*', index), re_path(r'^[a-zA-Z]*', index),
] ]
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