Simplied some code in django.conf.__init__.
This commit is contained in:
parent
a39d672ec7
commit
4ac5def4a2
|
@ -34,11 +34,8 @@ class LazySettings(LazyObject):
|
||||||
is used the first time we need any settings at all, if the user has not
|
is used the first time we need any settings at all, if the user has not
|
||||||
previously configured the settings manually.
|
previously configured the settings manually.
|
||||||
"""
|
"""
|
||||||
try:
|
settings_module = os.environ.get(ENVIRONMENT_VARIABLE)
|
||||||
settings_module = os.environ[ENVIRONMENT_VARIABLE]
|
if not settings_module:
|
||||||
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"
|
desc = ("setting %s" % name) if name else "settings"
|
||||||
raise ImproperlyConfigured(
|
raise ImproperlyConfigured(
|
||||||
"Requested %s, but settings are not configured. "
|
"Requested %s, but settings are not configured. "
|
||||||
|
|
Loading…
Reference in New Issue