Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Added check to the staticfiles app to make sure the STATIC_ROOT setti…

…ng 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
  • Loading branch information...
commit f3a9c719fe8cdbc06440dde63fe2011b3fa5c6ce 1 parent 6361a24
Jannis Leidel jezdez authored
Showing with 7 additions and 0 deletions.
  1. +7 −0 django/contrib/staticfiles/utils.py
7 django/contrib/staticfiles/utils.py
View
@@ -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")
Please sign in to comment.
Something went wrong with that request. Please try again.