From f29e5ecabb55d8cf8acfc2e0016375a526839c4c Mon Sep 17 00:00:00 2001 From: Skia Date: Wed, 14 Sep 2016 13:46:17 +0200 Subject: [PATCH] Fix static files for dev --- sith/settings.py | 1 + sith/urls.py | 6 +++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/sith/settings.py b/sith/settings.py index 7c99d27e..2f773bf1 100644 --- a/sith/settings.py +++ b/sith/settings.py @@ -187,6 +187,7 @@ MEDIA_URL = '/data/' # https://docs.djangoproject.com/en/1.8/howto/static-files/ STATIC_URL = '/static/' +STATIC_ROOT = './static/' # Auth configuration diff --git a/sith/urls.py b/sith/urls.py index d8d282d2..c93f36c9 100644 --- a/sith/urls.py +++ b/sith/urls.py @@ -40,5 +40,9 @@ urlpatterns = [ url(r'^ajax_select/', include(ajax_select_urls)), url(r'^i18n/', include('django.conf.urls.i18n')), url(r'^jsi18n/$', javascript_catalog, js_info_dict, name='javascript-catalog'), -] + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT) # TODO: remove me for production!!! +] + +if settings.DEBUG: + urlpatterns += static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT) + urlpatterns += static(settings.STATIC_URL, document_root=settings.STATIC_ROOT)