setting
This commit is contained in:
parent
439a5fabc3
commit
402705b4f3
|
|
@ -14,7 +14,7 @@ Including another URLconf
|
|||
2. Add a URL to urlpatterns: path('blog/', include('blog.urls'))
|
||||
"""
|
||||
from django.conf import settings
|
||||
from django.conf.urls.static import static
|
||||
from django.conf.urls.static import static, serve
|
||||
from django.contrib import admin
|
||||
from django.urls import include, path
|
||||
from rest_framework import routers
|
||||
|
|
@ -26,6 +26,7 @@ from apps.system.views import FileViewSet, LogoutView, Login2View
|
|||
from django.views.generic.base import TemplateView
|
||||
router = routers.DefaultRouter()
|
||||
router.register('file', FileViewSet, basename="file")
|
||||
from django.conf.urls import url
|
||||
|
||||
urlpatterns = [
|
||||
path('', TemplateView.as_view(template_name="index.html")),
|
||||
|
|
@ -39,6 +40,6 @@ urlpatterns = [
|
|||
path('api/docs/', include_docs_urls(title="接口文档",
|
||||
authentication_classes=[], permission_classes=[])),
|
||||
path('api/', include(router.urls)),
|
||||
|
||||
] + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
|
||||
|
||||
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)
|
||||
|
|
|
|||
Loading…
Reference in New Issue