文章目录
Django只内置了几个 Database Backend(mysql、oracle、sqllite3(默认)、postgresql_psycopg2),所以原生并不支持Microsoft SQL Server
django_SQL_serverdjangopyodbcazure__mssqldjango_2">django 的SQL server适配器,例如django-pyodbc-azure 或 mssql-django
djangopyodbcazure_3">1、django-pyodbc-azure
django_5">2、mssql-django
具体的选择根据自己python 和 django 的版本决定
3、注意
如果使用mssql引擎 启动项目时报错
django.core.exceptions.ImproperlyConfigured: 'mssql' isn't an available database backend or couldn't be imported. Check the above exception. To use one of the built-in
backends, use 'django.db.backends.XXX', where XXX is one of:'mysql', 'oracle', 'postgresql', 'sqlite3'
需注意自己安装的版本是否正确
亲测有效
python 3.8
django 4.2.14
pyodbc==5.2.0
mssql-django==1.5
python 3.8
Django==3.2.25
pymssql==2.3.1
pyodbc==5.1.0