在Django 2.0中使用Sql Server [英] Using Sql Server with Django 2.0
问题描述
我想在旧版MS SQL Server数据库中使用Django 2.0。
I would like to use Django 2.0 with legacy MS SQL Server database.
我可以找到的有关在MS SQL Server中使用Django的最新信息是将Sql Server与Django一起投入生产/这些天/ ,它与Django 1.11
有关。 /github.com/michiya/django-pyodbc-azure rel = noreferrer> django-pyodbc-azure ,但尚不支持Django 2.0:
django-pyodbc-azure问题#124
Latest information regarding usage Django with MS SQL Server i could find is Using Sql Server with Django in production/These days and it is about Django 1.11 Most supported seems django-pyodbc-azure but it's not supporting Django 2.0 yet: django-pyodbc-azure issue #124
推荐答案
找到解决方案并将其发布(如果有人遇到相同问题的话)。
Found the solution and post it if anyone facing same problem.
我在Django中使用了 django-pyodbc-azure 2.0.4.1 2.0.4
I used django-pyodbc-azure 2.0.4.1 in my Django 2.0.4
对我有用的设置:
DATABASES = {
'default': {
'ENGINE': 'sql_server.pyodbc',
'NAME': 'dbName',
'USER': 'yourUserName',
'PASSWORD': 'yourPassword',
'HOST': '(local)',
'PORT': '',
'OPTIONS': {
'driver': 'ODBC Driver 11 for SQL Server',
},
}
}
这篇关于在Django 2.0中使用Sql Server的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!