The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/home/tim/code/mysite/manage.py", line 10, in <module>
execute_from_command_line(sys.argv)
File "/home/tim/code/django/django/core/management/__init__.py", line
381, in execute_from_command_line
utility.execute()
File "/home/tim/code/django/django/core/management/__init__.py", line
357, in execute
django.setup()
File "/home/tim/code/django/django/__init__.py", line 24, in setup
apps.populate(settings.INSTALLED_APPS)
File "/home/tim/code/django/django/apps/registry.py", line 114, in
populate
app_config.import_models()
File "/home/tim/code/django/django/apps/config.py", line 211, in
import_models
self.models_module = import_module(models_module_name)
File
"/home/tim/.virtualenvs/django39/lib/python3.9/importlib/__init__.py",
line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 1030, in _gcd_import
File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
File "<frozen importlib._bootstrap>", line 986, in
_find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 680, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 790, in exec_module
File "<frozen importlib._bootstrap>", line 228, in
_call_with_frames_removed
File "/home/tim/code/mysite/polls/models.py", line 12, in <module>
class Question(models.Model):
File "/home/tim/code/django/django/db/models/base.py", line 117, in
__new__
new_class.add_to_class('_meta', Options(meta, app_label))
File "/home/tim/code/django/django/db/models/base.py", line 321, in
add_to_class
value.contribute_to_class(cls, name)
File "/home/tim/code/django/django/db/models/options.py", line 204, in
contribute_to_class
self.db_table = truncate_name(self.db_table,
connection.ops.max_name_length())
File "/home/tim/code/django/django/db/__init__.py", line 28, in
__getattr__
return getattr(connections[DEFAULT_DB_ALIAS], item)
File "/home/tim/code/django/django/db/utils.py", line 201, in
__getitem__
backend = load_backend(db['ENGINE'])
File "/home/tim/code/django/django/db/utils.py", line 121, in
load_backend
raise ImproperlyConfigured(
django.core.exceptions.ImproperlyConfigured: 'django_cockroachdb' isn't an
available database backend.
Try using 'django.db.backends.XXX', where XXX is one of:
'mysql', 'oracle', 'postgresql', 'sqlite3'
}}}
I'm not sure there's anything that could be done besides rephrasing the
error message to say something like this:
'django_cockroachdb' isn't an available database backend or couldn't be
imported. Check the above exception.
In this case, "Try using..." isn't so helpful either. Perhaps we could
only include that if `backend_name` begins with `django.`.
--
Ticket URL: <https://code.djangoproject.com/ticket/32197>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
* stage: Unreviewed => Accepted
Comment:
I agree that rephrasing the error message is all we can do.
--
Ticket URL: <https://code.djangoproject.com/ticket/32197#comment:1>
* owner: nobody => Hasan Ramezani
* status: new => assigned
--
Ticket URL: <https://code.djangoproject.com/ticket/32197#comment:2>
* has_patch: 0 => 1
--
Ticket URL: <https://code.djangoproject.com/ticket/32197#comment:3>
* stage: Accepted => Ready for checkin
--
Ticket URL: <https://code.djangoproject.com/ticket/32197#comment:4>
* status: assigned => closed
* resolution: => fixed
Comment:
In [changeset:"4cce1d13cfe9d8e56921c5fa8c61e3034dc8e20c" 4cce1d13]:
{{{
#!CommitTicketReference repository=""
revision="4cce1d13cfe9d8e56921c5fa8c61e3034dc8e20c"
Fixed #32197 -- Improved error message when loading a database backend
fails.
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/32197#comment:5>
Comment (by HamzaTarar):
I'm facing a 32197 error in Django anybody tells me how to resolve this
problem
--
Ticket URL: <https://code.djangoproject.com/ticket/32197#comment:6>