昨天我从 Windows 切换到 Ubuntu 24.04 LTS,我的 django 项目遇到了问题,并尝试了网络上的所有建议,但没有成功。我遇到以下问题:
django.core.exceptions.ImproperlyConfigured: 'django.db.backends.postgresql' 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:
'mysql', 'oracle', 'sqlite3'
网上的大部分建议都告诉我更新 django,但我已经在使用最新版本 5.0.4
postgresql 也工作正常。我可以连接。
价值是
django.db.backends.postgresql_psycopg2
,而不仅仅是django.db.backends.postgresql