Merge pull request #3002 from dato/django_serve_static_debug

Serve static files in debug mode
This commit is contained in:
Mouse Reeve 2023-09-22 16:17:58 -07:00 committed by GitHub
commit 85b647b7ab
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

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"