Serve static files in debug mode

This commit is contained in:
Adeodato Simó 2023-09-18 18:57:52 -03:00
parent a09b2ab45c
commit 1e495684af
No known key found for this signature in database
GPG key ID: CDF447845F1A986F

View file

@ -1,6 +1,7 @@
""" url routing for the app and api """ """ url routing for the app and api """
from django.conf.urls.static import static from django.conf.urls.static import static
from django.contrib import admin from django.contrib import admin
from django.contrib.staticfiles.urls import staticfiles_urlpatterns
from django.urls import path, re_path from django.urls import path, re_path
from django.views.generic.base import TemplateView from django.views.generic.base import TemplateView
@ -774,5 +775,8 @@ urlpatterns = [
path("guided-tour/<tour>", views.toggle_guided_tour), path("guided-tour/<tour>", views.toggle_guided_tour),
] + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT) ] + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
# Serves /static when DEBUG is true.
urlpatterns.extend(staticfiles_urlpatterns())
# pylint: disable=invalid-name # pylint: disable=invalid-name
handler500 = "bookwyrm.views.server_error" handler500 = "bookwyrm.views.server_error"