From: Aleksander Ɓukasz Date: Fri, 18 Oct 2013 14:05:32 +0000 (+0200) Subject: Serve media files in debug mode under katalog subdomain X-Git-Url: https://git.mdrn.pl/edumed.git/commitdiff_plain/386b21e9204f4267ad48ed7c8b96e73e4004d45f Serve media files in debug mode under katalog subdomain --- 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, + }), + )