From 9b484787a47613603d534eb9e05b4180fe0e0a67 Mon Sep 17 00:00:00 2001 From: "Adrian A. Baumann" Date: Thu, 23 Oct 2025 22:59:54 +0000 Subject: [PATCH] Add media file serving for cached diagrams - Configure MEDIA_URL/MEDIA_ROOT serving in DEBUG mode - Separate static and media file configurations for clarity --- VorgabenUI/urls.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/VorgabenUI/urls.py b/VorgabenUI/urls.py index 4ce78ac..070a613 100644 --- a/VorgabenUI/urls.py +++ b/VorgabenUI/urls.py @@ -34,5 +34,11 @@ urlpatterns = [ path('referenzen/', referenzen.views.tree, name="referenz_tree"), path('referenzen//', referenzen.views.detail, name="referenz_detail"), re_path(r'^diagramm/(?P.*)$', DiagrammProxyView.as_view()), -] + static(settings.STATIC_URL, document_root=settings.STATIC_ROOT) +] +# Serve static files +urlpatterns += static(settings.STATIC_URL, document_root=settings.STATIC_ROOT) + +# Serve media files (including cached diagrams) +if settings.DEBUG: + urlpatterns += static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)