'django_postgrespool'不是可用的数据库后端

时间:2013-09-17 17:36:24

标签: django django-postgresql

安装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

2 个答案:

答案 0 :(得分:2)

卸载psycopg2-2.5.1并安装psycopg2-2.4.6

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

答案 1 :(得分:0)

我找到了一个使用psycopg2-2.6.1而不是psycopg2-2.6的解决方案。

我将requirements.txt中的版本号从2.6调整到2.6.1,一切都完成了!