summaryrefslogtreecommitdiff
path: root/django/conf/__init__.py
diff options
context:
space:
mode:
authorCarl Meyer <carl@oddbird.net>2012-10-22 18:13:59 -0600
committerCarl Meyer <carl@oddbird.net>2012-10-22 18:49:08 -0600
commit3541a10d492db6d1f509f3a50a024568c16c5229 (patch)
tree6ced9b1f0533833be29b34cb1c0bd1efab2eeb86 /django/conf/__init__.py
parentea57112d531dfc6d2be50f47ee89f3a06f8ff1a8 (diff)
Fixed #19164 -- Fixed diffsettings command broken in fix for #18545.
Thanks Mario César for the report and draft patch.
Diffstat (limited to 'django/conf/__init__.py')
-rw-r--r--django/conf/__init__.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/django/conf/__init__.py b/django/conf/__init__.py
index 7452013671..1804c851bf 100644
--- a/django/conf/__init__.py
+++ b/django/conf/__init__.py
@@ -25,7 +25,7 @@ class LazySettings(LazyObject):
The user can manually configure settings prior to using them. Otherwise,
Django uses the settings module pointed to by DJANGO_SETTINGS_MODULE.
"""
- def _setup(self, name):
+ def _setup(self, name=None):
"""
Load the settings module pointed to by the environment variable. This
is used the first time we need any settings at all, if the user has not
@@ -36,11 +36,12 @@ class LazySettings(LazyObject):
if not settings_module: # If it's set but is an empty string.
raise KeyError
except KeyError:
+ desc = ("setting %s" % name) if name else "settings"
raise ImproperlyConfigured(
- "Requested setting %s, but settings are not configured. "
+ "Requested %s, but settings are not configured. "
"You must either define the environment variable %s "
"or call settings.configure() before accessing settings."
- % (name, ENVIRONMENT_VARIABLE))
+ % (desc, ENVIRONMENT_VARIABLE))
self._wrapped = Settings(settings_module)
self._configure_logging()