diff --git a/backend/config/__pycache__/urls.cpython-311.pyc b/backend/config/__pycache__/urls.cpython-311.pyc index c911527..6f9290e 100644 Binary files a/backend/config/__pycache__/urls.cpython-311.pyc and b/backend/config/__pycache__/urls.cpython-311.pyc differ diff --git a/backend/config/urls.py b/backend/config/urls.py index a84e9cb..2a3999e 100644 --- a/backend/config/urls.py +++ b/backend/config/urls.py @@ -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.*)$', 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) \ No newline at end of file