pythonsql-serverdjangopython-3.6django-mssql

python3.6.2 + django1.11.4 + django-mssql1.8 - is this combination supports? Unable to connect sql server from django


I am using pthon3.6.2 + django1.11.4 + django-mssql1.8 combination for my web application and unable to connect to sql server database. Following is the setting I am using in setting.py

DATABASES = {
    'default': {
        'NAME': 'DB1',
        'ENGINE': 'sqlserver_ado',
        'HOST': '192.168.5.245',
        'USER': 'user1',
        'PASSWORD': '123456',
    }
}
  1. Is this combination supports? i.e. django-mssql1.8 is supported or not with other two. The django-mssql website does not mention this
  2. If it supports please advise how to resolve.

I am getting the following error :

enter image description here


Solution

  • Finally I got the solution. I still don't know whether that combination supports or not. Instead of django-mssql I am using django-pyodbc-azure 1.11.0.0

    Installation :

    pip install django-pyodbc-azure
    

    Following is the code at settings.py. It workis properly.

    'default': {
            'NAME': 'DB1',
            'ENGINE': 'sql_server.pyodbc',
            'HOST': '192.168.5.245',
            'USER': 'user1',
            'PASSWORD': '123456',
            'OPTIONS' : {
                'driver' : 'SQL Server Native Client 11.0'
            }
        }