I am trying to connect to SQL server 2012
using Pyodbc
and Django
framework.
But the version of Django
is 2.1
As of today, django-pyodbc-azure supports Django 2.1. Below is my configuration.
And here is the code that I used to configure the connection.
DATABASES = {
'default': {
'ENGINE': "sql_server.pyodbc",
'HOST': "server_name",
'USER': "username",
'PASSWORD': "password",
'NAME': "database_name",
'OPTIONS' : {
'driver': 'ODBC Driver 13 for SQL Server',
},
}
}
Note: Don't use the IP address of the server as the HOST, instead use the computer name.