summaryrefslogtreecommitdiff
path: root/django/contrib/staticfiles/utils.py
diff options
context:
space:
mode:
authorJannis Leidel <jannis@leidel.info>2010-11-17 15:36:26 +0000
committerJannis Leidel <jannis@leidel.info>2010-11-17 15:36:26 +0000
commit33d8fcde8a317184a627492f008a4eab9333ed88 (patch)
tree7c877854327c83aefdfaf00e727d26bd766e519e /django/contrib/staticfiles/utils.py
parent9b45f6cd5444423693715cc2a04d91a0de75060b (diff)
Fixed #14693, #14709 -- Backwards incompatible change to rectify the confusion around the STATICFILES_URL and STATICFILES_ROOT settings.
* Two new global settings that will be used by -- **but are not limited to** -- the staticfiles app: STATIC_ROOT and STATIC_URL. * Moving the 'django.contrib.staticfiles.templatetags.staticfiles' template tag to the core ('django.templatetags.static') and renaming it to 'get_static_prefix'. * Moving the context processor 'django.contrib.staticfiles.context_processors.staticfiles' to the core ('django.core.context_processors.static') and renaming it to 'static'. * Paths in media definitions will use STATIC_URL as the prefix if the value is not None, and falls back to the previously used MEDIA_URL. Thanks again to the community for constructive criticism and Carl and Russ for sanity-inducing discussions on IRC. git-svn-id: http://code.djangoproject.com/svn/django/trunk@14592 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'django/contrib/staticfiles/utils.py')
-rw-r--r--django/contrib/staticfiles/utils.py16
1 files changed, 8 insertions, 8 deletions
diff --git a/django/contrib/staticfiles/utils.py b/django/contrib/staticfiles/utils.py
index 0071dbd370..428bb69b1e 100644
--- a/django/contrib/staticfiles/utils.py
+++ b/django/contrib/staticfiles/utils.py
@@ -33,13 +33,13 @@ def get_files(storage, ignore_patterns=[], location=''):
def check_settings():
"""
- Checks if the MEDIA_(ROOT|URL) and STATICFILES_(ROOT|URL)
+ Checks if the MEDIA_(ROOT|URL) and STATIC_(ROOT|URL)
settings have the same value.
"""
- if settings.MEDIA_URL == settings.STATICFILES_URL:
- raise ImproperlyConfigured("The MEDIA_URL and STATICFILES_URL "
- "settings must have individual values")
- if ((settings.MEDIA_ROOT and settings.STATICFILES_ROOT) and
- (settings.MEDIA_ROOT == settings.STATICFILES_ROOT)):
- raise ImproperlyConfigured("The MEDIA_ROOT and STATICFILES_ROOT "
- "settings must have individual values")
+ if settings.MEDIA_URL == settings.STATIC_URL:
+ raise ImproperlyConfigured("The MEDIA_URL and STATIC_URL "
+ "settings must have different values")
+ if ((settings.MEDIA_ROOT and settings.STATIC_ROOT) and
+ (settings.MEDIA_ROOT == settings.STATIC_ROOT)):
+ raise ImproperlyConfigured("The MEDIA_ROOT and STATIC_ROOT "
+ "settings must have different values")