From 3304d862cb5e9c7354935c7d4206ee90e7d9501d Mon Sep 17 00:00:00 2001 From: "M.Ravi" Date: Wed, 5 Jul 2017 00:07:06 +0200 Subject: [PATCH] Moved static images urlpattern out of DEBUG case --- dynamicweb/urls.py | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/dynamicweb/urls.py b/dynamicweb/urls.py index 0b1a0844..dad511fc 100644 --- a/dynamicweb/urls.py +++ b/dynamicweb/urls.py @@ -42,12 +42,11 @@ urlpatterns += i18n_patterns('', url(r'^blog/', include('ungleich.urls', namespace='ungleich')), url(r'^', include('cms.urls')) ) - +urlpatterns += patterns('', + url(r'^media/(?P.*)$', + 'django.views.static.serve', { + 'document_root': settings.MEDIA_ROOT, + }), + ) if settings.DEBUG: - urlpatterns += patterns('', - url(r'^media/(?P.*)$', - 'django.views.static.serve', { - 'document_root': settings.MEDIA_ROOT, - }), - ) urlpatterns += patterns('',url(r'^__debug__/', include(debug_toolbar.urls)))