From 386b21e9204f4267ad48ed7c8b96e73e4004d45f Mon Sep 17 00:00:00 2001 From: =?utf8?q?Aleksander=20=C5=81ukasz?= Date: Fri, 18 Oct 2013 16:05:32 +0200 Subject: [PATCH] Serve media files in debug mode under katalog subdomain --- edumed/milurls.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/edumed/milurls.py b/edumed/milurls.py index 0fe0f5d..609fd72 100644 --- a/edumed/milurls.py +++ b/edumed/milurls.py @@ -13,4 +13,10 @@ urlpatterns = i18n_patterns('', handler404 = 'edumed.views.mil_404_view' - +from django.conf import settings +if settings.DEBUG: + urlpatterns += patterns('', + url(r'^media/(?P.*)$', 'django.views.static.serve', { + 'document_root': settings.MEDIA_ROOT, + }), + ) -- 2.20.1