Commit 9e879fb6 by 周田

feat:生产环境下的静态文件打包问题

parent 5fa674b1
import mimetypes
mimetypes.add_type("text/css", ".css", True)
mimetypes.add_type("text/javascript", ".js", True)
...@@ -17,6 +17,9 @@ from django.contrib import admin ...@@ -17,6 +17,9 @@ 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 from .views import index, test
from django.conf import settings
from django.views.static import serve
from drf_yasg.views import get_schema_view from drf_yasg.views import get_schema_view
from drf_yasg import openapi from drf_yasg import openapi
...@@ -33,9 +36,12 @@ urlpatterns = [ ...@@ -33,9 +36,12 @@ urlpatterns = [
path('admin/', admin.site.urls), path('admin/', admin.site.urls),
path("", index), path("", index),
# path("test/", test), # path("test/", test),
# path("mqtt/", include("mqtt.urls")), path("mqtt/", include("mqtt.urls")),
# path("chat/", include("chat.urls")), path("chat/", include("chat.urls")),
path("op/", include("device_data_op.urls")), path("op/", include("device_data_op.urls")),
re_path(r'^assets/(?P<path>.*)/$', serve, {'document_root': settings.STATIC_ROOT}),
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'),
] ]
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