serve media on debug
authorJan Szejko <janek37@gmail.com>
Tue, 13 Mar 2018 10:55:17 +0000 (11:55 +0100)
committerJan Szejko <janek37@gmail.com>
Tue, 13 Mar 2018 10:55:17 +0000 (11:55 +0100)
edumed/urls.py

index 47055d9..38005aa 100644 (file)
@@ -43,3 +43,8 @@ urlpatterns += (
     url(r'^(?P<url>[^/]*/|)$',
         lambda request, url: flatpage(request, 'turniej/' + url)),
 )
+
+if settings.DEBUG:
+    urlpatterns += (
+        url(r'^media/(?P<path>.*)$', 'django.views.static.serve', {'document_root': settings.MEDIA_ROOT}),
+    )