[英]python3.6.2 + django1.11.4 + django-mssql1.8 - is this combination supports? Unable to connect sql server from django
I am using pthon3.6.2
+ django1.11.4
+ django-mssql1.8
combination for my web application and unable to connect to sql server
database. 我正在为我的Web应用程序使用
pthon3.6.2
+ django1.11.4
+ django-mssql1.8
组合,但无法连接到sql server
数据库。 Following is the setting I am using in setting.py 以下是我在setting.py中使用的设置
DATABASES = {
'default': {
'NAME': 'DB1',
'ENGINE': 'sqlserver_ado',
'HOST': '192.168.5.245',
'USER': 'user1',
'PASSWORD': '123456',
}
}
I am getting the following error : 我收到以下错误:
Finally I got the solution. 终于我找到了解决方案。 I still don't know whether that combination supports or not.
我仍然不知道该组合是否支持。 Instead of django-mssql I am using django-pyodbc-azure 1.11.0.0
我正在使用django-pyodbc-azure 1.11.0.0而不是django-mssql
Installation : 安装方式
pip install django-pyodbc-azure
Following is the code at settings.py. 以下是settings.py中的代码。 It workis properly.
它工作正常。
'default': {
'NAME': 'DB1',
'ENGINE': 'sql_server.pyodbc',
'HOST': '192.168.5.245',
'USER': 'user1',
'PASSWORD': '123456',
'OPTIONS' : {
'driver' : 'SQL Server Native Client 11.0'
}
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.