Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

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 authored January 30, 2011

Showing 1 changed file with 7 additions and 0 deletions. Show diff stats Hide diff stats

  1. 7  django/contrib/staticfiles/utils.py
7  django/contrib/staticfiles/utils.py
@@ -45,3 +45,10 @@ def check_settings():
45 45
             (settings.MEDIA_ROOT == settings.STATIC_ROOT)):
46 46
         raise ImproperlyConfigured("The MEDIA_ROOT and STATIC_ROOT "
47 47
                                    "settings must have different values")
  48
+    for path in settings.STATICFILES_DIRS:
  49
+        # in case the item contains a prefix
  50
+        if isinstance(path, (list, tuple)):
  51
+            path = path[1]
  52
+        if os.path.abspath(settings.STATIC_ROOT) == os.path.abspath(path):
  53
+            raise ImproperlyConfigured("The STATICFILES_DIRS setting should "
  54
+                                       "not contain the STATIC_ROOT setting")

0 notes on commit f3a9c71

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