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
This commit is contained in:
Jannis Leidel 2011-01-30 23:29:31 +00:00
parent 6361a242af
commit f3a9c719fe
1 changed files with 7 additions and 0 deletions

View File

@ -45,3 +45,10 @@ def check_settings():
(settings.MEDIA_ROOT == settings.STATIC_ROOT)): (settings.MEDIA_ROOT == settings.STATIC_ROOT)):
raise ImproperlyConfigured("The MEDIA_ROOT and STATIC_ROOT " raise ImproperlyConfigured("The MEDIA_ROOT and STATIC_ROOT "
"settings must have different values") "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")