gpt4 book ai didi

django - “django_postgrespool”不是可用的数据库后端

转载 作者:行者123 更新时间:2023-12-04 21:17:44 25 4
gpt4 key购买 nike

安装后django_postgrespool并相应地配置我的项目,我收到以下错误:

Traceback (most recent call last):
File "C:\Users\Administrator\Documents\my_proj\my_module.py", line 14, in <module>
from cortex.my_app.models import MyModel
File "C:\Users\Administrator\Documents\my_proj\my_app\models.py", line 3, in <module>
from django.db import models
File "C:\Users\Administrator\virtual_environments\spyker\lib\site-packages\django\db\__init__.py", line 40, in <module>
backend = load_backend(connection.settings_dict['ENGINE'])
File "C:\Users\Administrator\virtual_environments\spyker\lib\site-packages\django\db\__init__.py", line 34, in __getattr__
return getattr(connections[DEFAULT_DB_ALIAS], item)
File "C:\Users\Administrator\virtual_environments\spyker\lib\site-packages\django\db\utils.py", line 92, in __getitem__
backend = load_backend(db['ENGINE'])
File "C:\Users\Administrator\virtual_environments\spyker\lib\site-packages\django\db\utils.py", line 44, in load_backend
raise ImproperlyConfigured(error_msg)
django.core.exceptions.ImproperlyConfigured: 'django_postgrespool' isn't an available database backend.
Try using django.db.backends.XXX, where XXX is one of:
'dummy', 'mysql', 'oracle', 'postgresql_psycopg2', 'sqlite3'
Error was: cannot import name Diagnostics

我当然检查过我可以 import django_postgrespool在同一个环境中。
我找到了 this similar issue ,但是它的解决方案是使用 django 1.4+ 而我使用的是 1.4.3

最佳答案

卸载 psycopg2-2.5.1 并安装 psycopg2-2.4.6 .

我不知道为什么它解决了这个问题,当 psycopg2-2.5.1 是最新 postgrespool 的要求时。我使用的是 Windows Python 2.7.3 AMD64。
我已经 reported this as a bug到 django-postgrespool

关于django - “django_postgrespool”不是可用的数据库后端,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18856336/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com