无法使用django-mssql提供程序 [英] Cannot use django-mssql provider
问题描述
有人知道如何使用django-mssql提供程序吗?我已经安装了要求,但无法正常工作.
Does anyone know how to use the django-mssql provider? I've installed the requirements but I cannot get it to work.
在settings.py中没有sqlserver_ado,它可以很好地导入:
Without sqlserver_ado in settings.py it imports fine:
(testenv) C:\Users\Robin\test>python manage.py shell
Python 2.7.2 (default, Jun 12 2011, 14:24:46) [MSC v.1500 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
(InteractiveConsole)
>>> import sqlserver_ado
>>> ^Z
在settings.py中将数据库设置为使用sqlserver_ado:
With a database set to use sqlserver_ado in settings.py:
(testenv) C:\Users\Robin\test>python manage.py shell
ImproperlyConfigured: 'sqlserver_ado' isn't an available database backend.
Try using 'django.db.backends.XXX', where XXX is one of:
u'mysql', u'oracle', u'postgresql_psycopg2', u'sqlite3'
Error was: cannot import name InterfaceError
Django == 1.5django-mssql == 1.5b1
Django==1.5 django-mssql==1.5b1
浏览django-mssql的源代码表明,它正在尝试从django.db.utils中导入InterfaceError,而Django 1.5中不存在此错误
Browsing the source for django-mssql reveals that it's trying to import InterfaceError from django.db.utils which doesn't exist in Django 1.5
推荐答案
It's mentioned on the project's Bitbucket page at https://bitbucket.org/Manfre/django-mssql/overview that:
"django-mssql的当前版本支持Django 1.6.如果使用旧版本的Django,则需要使用django-mssql的早期版本.
"The current version of django-mssql supports Django 1.6. If using an older version of Django, you will need to use an earlier version of django-mssql.
django-mssql 1.4支持Django 1.4和1.5."
django-mssql 1.4 supports Django 1.4 and 1.5."
我安装了1.4,现在只需要使提供程序正常工作即可.
I installed 1.4 and now I just need to get the provider working.
这篇关于无法使用django-mssql提供程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!