Serve media files in debug mode under katalog subdomain
authorAleksander Łukasz <aleksander.lukasz@nowoczesnapolska.org.pl>
Fri, 18 Oct 2013 14:05:32 +0000 (16:05 +0200)
committerAleksander Łukasz <aleksander.lukasz@nowoczesnapolska.org.pl>
Tue, 22 Oct 2013 07:49:55 +0000 (09:49 +0200)
edumed/milurls.py

index 0fe0f5d..609fd72 100644 (file)
@@ -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<path>.*)$', 'django.views.static.serve', {
+            'document_root': settings.MEDIA_ROOT,
+        }),
+   )