From 9a524e3c5bd8fafd4996a6f1486de8a2cbb052a2 Mon Sep 17 00:00:00 2001 From: Erik Romijn Date: Sat, 25 May 2013 20:25:29 +0200 Subject: [PATCH] Fixed #20443 -- Import errors in settings cause confusing error messages --- django/conf/__init__.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/django/conf/__init__.py b/django/conf/__init__.py index f876c490c86..61584391cd3 100644 --- a/django/conf/__init__.py +++ b/django/conf/__init__.py @@ -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.