summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJannis Leidel <jannis@leidel.info>2011-01-30 23:29:31 +0000
committerJannis Leidel <jannis@leidel.info>2011-01-30 23:29:31 +0000
commitf3a9c719fe8cdbc06440dde63fe2011b3fa5c6ce (patch)
treec6368a09e65744a2ba584418422d83e4493dc367
parent6361a242af3bed3f822b4c14c13624869478abaf (diff)
Added check to the staticfiles app to make sure the STATIC_ROOT setting isn't accidentally added to the STATICFILES_DIRS setting. Thanks for the suggestion, SmileyChris and harijay.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@15376 bcc190cf-cafb-0310-a4f2-bffc1f526a37
-rw-r--r--django/contrib/staticfiles/utils.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/django/contrib/staticfiles/utils.py b/django/contrib/staticfiles/utils.py
index e7598d4aa5..217bc7a706 100644
--- a/django/contrib/staticfiles/utils.py
+++ b/django/contrib/staticfiles/utils.py
@@ -45,3 +45,10 @@ def check_settings():
(settings.MEDIA_ROOT == settings.STATIC_ROOT)):
raise ImproperlyConfigured("The MEDIA_ROOT and STATIC_ROOT "
"settings must have different values")
+ for path in settings.STATICFILES_DIRS:
+ # in case the item contains a prefix
+ if isinstance(path, (list, tuple)):
+ path = path[1]
+ if os.path.abspath(settings.STATIC_ROOT) == os.path.abspath(path):
+ raise ImproperlyConfigured("The STATICFILES_DIRS setting should "
+ "not contain the STATIC_ROOT setting")