version 22
This commit is contained in:
parent
5082c8c2c8
commit
e1b2abf2d5
Binary file not shown.
@ -15,15 +15,15 @@ Including another URLconf
|
||||
2. Add a URL to urlpatterns: path('blog/', include('blog.urls'))
|
||||
"""
|
||||
from django.contrib import admin
|
||||
from django.urls import include, path
|
||||
from django.urls import include, path, re_path
|
||||
from django.conf import settings
|
||||
from django.conf.urls.static import static
|
||||
from django.views.static import serve
|
||||
|
||||
urlpatterns = [
|
||||
path("admin/", admin.site.urls),
|
||||
# Serve assets and static files explicitly before the catch-all
|
||||
re_path(r'^assets/(?P<path>.*)$', serve, {'document_root': settings.BASE_DIR.parent / "frontend" / "dist" / "assets"}),
|
||||
path(settings.STATIC_URL.lstrip('/'), serve, {'document_root': settings.STATIC_ROOT}),
|
||||
path("", include("core.urls")),
|
||||
]
|
||||
|
||||
if settings.DEBUG:
|
||||
urlpatterns += static("/assets/", document_root=settings.BASE_DIR.parent / "frontend" / "dist" / "assets")
|
||||
urlpatterns += static(settings.STATIC_URL, document_root=settings.STATIC_ROOT)
|
||||
Loading…
x
Reference in New Issue
Block a user