Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
V
vue_django_test
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
周田
vue_django_test
Commits
f48514d3
Commit
f48514d3
authored
Sep 22, 2023
by
周田
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mod: release
parent
eac543da
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
27 additions
and
9 deletions
+27
-9
.gitignore
.gitignore
+1
-0
poetry.lock
poetry.lock
+1
-1
pyproject.toml
pyproject.toml
+1
-0
settings.py
vue_django/settings.py
+21
-6
urls.py
vue_django/urls.py
+3
-2
No files found.
.gitignore
View file @
f48514d3
...
@@ -3,3 +3,4 @@ __pycache__
...
@@ -3,3 +3,4 @@ __pycache__
.idea
.idea
assets
assets
*.tar
*.tar
static
poetry.lock
View file @
f48514d3
...
@@ -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
"
pyproject.toml
View file @
f48514d3
...
@@ -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]
...
...
vue_django/settings.py
View file @
f48514d3
...
@@ -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
=
Tru
e
DEBUG
=
Fals
e
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'
,
},
}
vue_django/urls.py
View file @
f48514d3
...
@@ -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
),
]
]
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment