1
0
mirror of https://github.com/django/django.git synced 2024-12-23 01:25:58 +00:00

Fixed #20443 -- Import errors in settings cause confusing error messages

This commit is contained in:
Erik Romijn 2013-05-25 20:25:29 +02:00
parent 31f6421b13
commit 9a524e3c5b

View File

@ -127,7 +127,10 @@ class Settings(BaseSettings):
try:
mod = importlib.import_module(self.SETTINGS_MODULE)
except ImportError as e:
raise ImportError("Could not import settings '%s' (Is it on sys.path?): %s" % (self.SETTINGS_MODULE, e))
raise ImportError(
"Could not import settings '%s' (Is it on sys.path? Is there an import error in the settings file?): %s"
% (self.SETTINGS_MODULE, e)
)
# Settings that should be converted into tuples if they're mistakenly entered
# as strings.