Skip to content
Browse files

Merge pull request #1217 from erikr/better-settings-errors2

Fixed #20443 -- Import errors in settings cause confusing error messages
  • Loading branch information...
2 parents 0fa8d43 + 9a524e3 commit 1a4b43521883ce85dfbda29b89822a59ffc5220b @claudep claudep committed
Showing with 4 additions and 1 deletion.
  1. +4 −1 django/conf/
5 django/conf/
@@ -127,7 +127,10 @@ def __init__(self, settings_module):
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.

0 comments on commit 1a4b435

Please sign in to comment.
Something went wrong with that request. Please try again.