-
Notifications
You must be signed in to change notification settings - Fork 130
Getting started
Sicong edited this page Jun 21, 2021
·
9 revisions
-
Install Django 2.2 (or newer)
-
Install mssql-django :
pip install mssql-django -
Set the
ENGINEsetting in the settings.py file used by your Django application or project tomssqlmodule path :'ENGINE': 'mssql'
-
Install Django 2.2 (or newer)
-
Install Microsoft ODBC Driver 17 for SQL Server (or equivalent)
-
Install mssql-django :
pip install mssql-django -
Set the
ENGINEsetting in the settings.py file used by your Django application or project to'mssql'module path :'ENGINE': 'mssql'
Here is an example of the database settings:
DATABASES = {
'default': {
'ENGINE': 'mssql',
'NAME': 'mydb',
'USER': 'user@myserver',
'PASSWORD': 'password',
'HOST': 'myserver.database.windows.net',
'PORT': '',
'OPTIONS': {
'driver': 'ODBC Driver 17 for SQL Server',
},
},
}
# set this to False if you want to turn off pyodbc's connection pooling
DATABASE_CONNECTION_POOLING = False