ModuleNotFoundError:Ubuntu 24.04 上没有名为“django.db.backends.postgresql”的模块

问题描述 投票:0回答:1

昨天我从 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 也工作正常。我可以连接。

python django postgresql ubuntu-24.04
1个回答
0
投票

价值是

django.db.backends.postgresql_psycopg2
,而不仅仅是
django.db.backends.postgresql

© www.soinside.com 2019 - 2024. All rights reserved.