summaryrefslogtreecommitdiff
path: root/django/db/utils.py
diff options
context:
space:
mode:
authorHasan Ramezani <hasan.r67@gmail.com>2020-11-15 21:34:35 +0100
committerMariusz Felisiak <felisiak.mariusz@gmail.com>2020-11-16 06:05:03 +0100
commit4cce1d13cfe9d8e56921c5fa8c61e3034dc8e20c (patch)
treead02953da9749b21810481f3ac29554718104cf2 /django/db/utils.py
parent464a4c0c59277056b5d3c1132ac1b4c6085aee08 (diff)
Fixed #32197 -- Improved error message when loading a database backend fails.
Diffstat (limited to 'django/db/utils.py')
-rw-r--r--django/db/utils.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/django/db/utils.py b/django/db/utils.py
index 28afa6cd07..cb52e6e9ea 100644
--- a/django/db/utils.py
+++ b/django/db/utils.py
@@ -120,8 +120,10 @@ def load_backend(backend_name):
if backend_name not in ['django.db.backends.%s' % b for b in builtin_backends]:
backend_reprs = map(repr, sorted(builtin_backends))
raise ImproperlyConfigured(
- "%r isn't an available database backend.\n"
- "Try using 'django.db.backends.XXX', where XXX is one of:\n"
+ "%r isn't an available database backend or couldn't be "
+ "imported. Check the above exception. To use one of the "
+ "built-in backends, use 'django.db.backends.XXX', where XXX "
+ "is one of:\n"
" %s" % (backend_name, ", ".join(backend_reprs))
) from e_user
else: