I’d like to recommend the library Django-mssql-backend, for the official documentation follow the link:. https://pypi.org/project/django-mssql-backend/
It is the solution that I currently adopt for my personal and professional projects, never had problems with its use, the installation takes place by the following code:
pip install django-mssql-backend
OBS:. remember to carefully read the documentation, this is important!
Example( Settings.py ):
DATABASES = {
'default': {
'ENGINE': 'sql_server.pyodbc',
'NAME': 'mydb',
'USER': 'user@myserver',
'PASSWORD': 'password',
'HOST': 'myserver.database.windows.net',
'PORT': '',
'OPTIONS': {
'driver': 'ODBC Driver 13 for SQL Server',
},
},
}
# set this to False if you want to turn off pyodbc's connection pooling
DATABASE_CONNECTION_POOLING = False
One of the dependencies is pyodbc in version 3.0 or higher, lib also supports regex, which I often use.
If you have problems with this lib, be aware that it is not due to the need to install an "ODBC DRIVER", this is more likely to occur in linux operating systems.
For more details just read the official documentation,
Good Luck!
It worked out! Thanks so much for your help!
– Murilo Krugner
@murilokrugner worth will mark the answer as accepted (see the pq)
– rLinhares