diff options
Diffstat (limited to 'django/contrib/staticfiles/utils.py')
| -rw-r--r-- | django/contrib/staticfiles/utils.py | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/django/contrib/staticfiles/utils.py b/django/contrib/staticfiles/utils.py index e4297aff2b..efd67ac8e8 100644 --- a/django/contrib/staticfiles/utils.py +++ b/django/contrib/staticfiles/utils.py @@ -13,7 +13,7 @@ def matches_patterns(path, patterns): return any(fnmatch.fnmatchcase(path, pattern) for pattern in patterns) -def get_files(storage, ignore_patterns=None, location=''): +def get_files(storage, ignore_patterns=None, location=""): """ Recursively walk the storage directories yielding the paths of all files that should be copied. @@ -48,18 +48,24 @@ def check_settings(base_url=None): if not base_url: raise ImproperlyConfigured( "You're using the staticfiles app " - "without having set the required STATIC_URL setting.") + "without having set the required STATIC_URL setting." + ) if settings.MEDIA_URL == base_url: raise ImproperlyConfigured( "The MEDIA_URL and STATIC_URL settings must have different values" ) - if (settings.DEBUG and settings.MEDIA_URL and settings.STATIC_URL and - settings.MEDIA_URL.startswith(settings.STATIC_URL)): + if ( + settings.DEBUG + and settings.MEDIA_URL + and settings.STATIC_URL + and settings.MEDIA_URL.startswith(settings.STATIC_URL) + ): raise ImproperlyConfigured( "runserver can't serve media if MEDIA_URL is within STATIC_URL." ) - if ((settings.MEDIA_ROOT and settings.STATIC_ROOT) and - (settings.MEDIA_ROOT == settings.STATIC_ROOT)): + if (settings.MEDIA_ROOT and settings.STATIC_ROOT) and ( + settings.MEDIA_ROOT == settings.STATIC_ROOT + ): raise ImproperlyConfigured( "The MEDIA_ROOT and STATIC_ROOT settings must have different values" ) |
