This commit is contained in:
caoqianming 2021-03-26 16:26:29 +08:00
parent 0a1873debc
commit a6b97a2eba
2 changed files with 1 additions and 2 deletions

View File

@ -123,7 +123,7 @@ CORS_ORIGIN_ALLOW_ALL = True
# Static files (CSS, JavaScript, Images)
# https://docs.djangoproject.com/en/3.0/howto/static-files/
STATIC_URL = '/api/static/'
STATIC_URL = '/static/'
STATIC_ROOT = os.path.join(BASE_DIR, 'static')
MEDIA_URL = '/media/'

View File

@ -67,5 +67,4 @@ urlpatterns = [
path('api/supervision/', include('apps.supervision.urls')),
path('api/docs/', include_docs_urls(title="接口文档",authentication_classes=[], permission_classes=[])),
path('api/', include(router.urls)),
url(r'^api/static/(?P<path>.*)$', serve,{'document_root': settings.STATIC_ROOT}, name='static'),
] + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT) + static(settings.STATIC_URL, document_root=settings.STATIC_ROOT)