static 测试
This commit is contained in:
parent
5b76549a19
commit
a3c6be5ada
|
|
@ -123,9 +123,9 @@ CORS_ORIGIN_ALLOW_ALL = True
|
||||||
# Static files (CSS, JavaScript, Images)
|
# Static files (CSS, JavaScript, Images)
|
||||||
# https://docs.djangoproject.com/en/3.0/howto/static-files/
|
# https://docs.djangoproject.com/en/3.0/howto/static-files/
|
||||||
|
|
||||||
STATIC_URL = '/static/'
|
STATIC_URL = '/api/static/'
|
||||||
STATIC_ROOT = os.path.join(BASE_DIR, 'static')
|
STATIC_ROOT = os.path.join(BASE_DIR, 'static')
|
||||||
STATICFILES_DIRS =[os.path.join(BASE_DIR, 'dist/static')]
|
STATICFILES_DIRS =[os.path.join(BASE_DIR, 'static')]
|
||||||
|
|
||||||
MEDIA_URL = '/media/'
|
MEDIA_URL = '/media/'
|
||||||
MEDIA_ROOT = os.path.join(BASE_DIR, 'media')
|
MEDIA_ROOT = os.path.join(BASE_DIR, 'media')
|
||||||
|
|
|
||||||
|
|
@ -67,5 +67,4 @@ urlpatterns = [
|
||||||
path('api/supervision/', include('apps.supervision.urls')),
|
path('api/supervision/', include('apps.supervision.urls')),
|
||||||
path('api/docs/', include_docs_urls(title="接口文档",authentication_classes=[], permission_classes=[])),
|
path('api/docs/', include_docs_urls(title="接口文档",authentication_classes=[], permission_classes=[])),
|
||||||
path('api/', include(router.urls)),
|
path('api/', include(router.urls)),
|
||||||
url(r'^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)
|
] + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT) + static(settings.STATIC_URL, document_root=settings.STATIC_ROOT)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue