Skip to content


Subversion checkout URL

You can clone with
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: bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
1 parent 6361a24 commit f3a9c719fe8cdbc06440dde63fe2011b3fa5c6ce @jezdez jezdez committed
Showing with 7 additions and 0 deletions.
  1. +7 −0 django/contrib/staticfiles/
7 django/contrib/staticfiles/
@@ -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")

0 comments on commit f3a9c71

Please sign in to comment.
Something went wrong with that request. Please try again.