Created
January 9, 2014 14:47
-
-
Save loic/8335204 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/django/contrib/staticfiles/finders.py b/django/contrib/staticfiles/finders.py | |
index eede6fb..eed88a0 100644 | |
--- a/django/contrib/staticfiles/finders.py | |
+++ b/django/contrib/staticfiles/finders.py | |
@@ -57,7 +57,7 @@ class FileSystemFinder(BaseFinder): | |
prefix, root = root | |
else: | |
prefix = '' | |
- if os.path.abspath(settings.STATIC_ROOT) == os.path.abspath(root): | |
+ if settings.STATIC_ROOT and os.path.abspath(settings.STATIC_ROOT) == os.path.abspath(root): | |
raise ImproperlyConfigured( | |
"The STATICFILES_DIRS setting should " | |
"not contain the STATIC_ROOT setting") | |
diff --git a/django/contrib/staticfiles/storage.py b/django/contrib/staticfiles/storage.py | |
index b5d05aa..3c8441e 100644 | |
--- a/django/contrib/staticfiles/storage.py | |
+++ b/django/contrib/staticfiles/storage.py | |
@@ -32,14 +32,17 @@ class StaticFilesStorage(FileSystemStorage): | |
location = settings.STATIC_ROOT | |
if base_url is None: | |
base_url = settings.STATIC_URL | |
- if not location: | |
- raise ImproperlyConfigured("You're using the staticfiles app " | |
- "without having set the STATIC_ROOT " | |
- "setting to a filesystem path.") | |
- check_settings(base_url) | |
super(StaticFilesStorage, self).__init__(location, base_url, | |
*args, **kwargs) | |
+ if location is None: | |
+ self.location = None | |
+ def path(self, name): | |
+ if not self.location: | |
+ raise ImproperlyConfigured("You're using the staticfiles app " | |
+ "without having set the STATIC_ROOT " | |
+ "setting to a filesystem path.") | |
+ return super(StaticFilesStorage, self).path(name) | |
class CachedFilesMixin(object): | |
default_template = """url("%s")""" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment