python3.8.8安装mssql-django
pip install mssql-django
pip list
Package Version
------------ -------
asgiref 3.5.2
Django 3.2.16
mssql-django 1.1.3
pip 22.3
pyodbc 4.0.35
pytz 2022.6
setuptools 65.5.0
sqlparse 0.4.3
wheel 0.37.1
- settings.py
DATABASES = {
'default': {
'ENGINE': 'mssql',
'NAME': 'testdb', # 数据库名称
'HOST': '192.168.1.2', # 地址
'PORT': '1433', # 端口
'USER': 'sa', # 用户名
'PASSWORD': '123456', # 密码
'OPTIONS': {
'driver': 'ODBC Driver 17 for SQL Server',
'MARS_Connection': True,
},
}
}
标签:ENGINE,配置,sqlserver,django,pip,123456,mssql
From: https://www.cnblogs.com/momolei/p/16936390.html