mirror of
https://github.com/django/django.git
synced 2024-12-25 10:35:48 +00:00
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:
parent
6361a242af
commit
f3a9c719fe
@ -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")
|
||||||
|
Loading…
Reference in New Issue
Block a user