From b84440b8576713f6f1b179a1e1163342c10c83c0 Mon Sep 17 00:00:00 2001 From: Ole Laursen Date: Wed, 18 Dec 2013 13:18:58 +0000 Subject: [PATCH] MEDIA_ROOT -> STATIC_ROOT - apparently we don't really use MEDIA_ROOT at the moment since all files are handled not through file fields, but through explicit management of their paths - Legacy-Id: 6980 --- ietf/settings.py | 5 ++--- ietf/urls.py | 8 ++++---- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/ietf/settings.py b/ietf/settings.py index 34ea86cfb..490d896f6 100644 --- a/ietf/settings.py +++ b/ietf/settings.py @@ -83,13 +83,12 @@ SITE_ID = 1 # to load the internationalization machinery. USE_I18N = False -# Absolute path to the directory that holds media. -MEDIA_ROOT = BASE_DIR + "/../static/" +USE_TZ = False -# URL that handles the media served from MEDIA_ROOT. MEDIA_URL = 'http://www.ietf.org/' STATIC_URL = "/" +STATIC_ROOT = os.path.abspath(BASE_DIR + "/../static/") WSGI_APPLICATION = "ietf.wsgi.application" diff --git a/ietf/urls.py b/ietf/urls.py index ec51906b6..333d60144 100644 --- a/ietf/urls.py +++ b/ietf/urls.py @@ -68,10 +68,10 @@ urlpatterns = patterns('', if settings.SERVER_MODE in ('development', 'test'): urlpatterns += patterns('', - (r'^(?P(?:images|css|js)/.*)$', 'django.views.static.serve', {'document_root': settings.MEDIA_ROOT}), - (r'^(?Padmin/(?:img|css|js)/.*)$', 'django.views.static.serve', {'document_root': settings.MEDIA_ROOT}), - (r'^(?Psecretariat/(img|css|js)/.*)$', 'django.views.static.serve', {'document_root': settings.MEDIA_ROOT}), - (r'^(?Probots\.txt)$', 'django.views.static.serve', {'document_root': settings.MEDIA_ROOT+"dev/"}), + (r'^(?P(?:images|css|js)/.*)$', 'django.views.static.serve', {'document_root': settings.STATIC_ROOT}), + (r'^(?Padmin/(?:img|css|js)/.*)$', 'django.views.static.serve', {'document_root': settings.STATIC_ROOT}), + (r'^(?Psecretariat/(img|css|js)/.*)$', 'django.views.static.serve', {'document_root': settings.STATIC_ROOT}), + (r'^(?Probots\.txt)$', 'django.views.static.serve', {'document_root': settings.STATIC_ROOT+"dev/"}), (r'^_test500/$', lambda x: None), (r'^environment/$', 'ietf.help.views.environment'), )