﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
29659	Not able to connect to SQL Server 2012 from current version of DJango and Python	Gurmeet Kaur	nobody	"Hi All,

I am trying to connect to SQL server 2012 using Pyodbc and DJango framework but the version of Django is 2.1. Now, when I try to connect using below code when I only have Pyodbc installed then the below code doesnot run.
{{{
DATABASES = {
    'default': {
        # 'ENGINE': '{ODBC Driver 11 for SQL Server}', Tried this as well but it did not work.
        'ENGINE': 'sql_server.pyodbc',
        'NAME': 'MY_DATABASE',
        # 'HOST': 'XXX.XX.XXX.XXX', Tried this as well but it did not work.
        'SERVER': 'XXX.XX.XXX.XXX',
        # 'HOST': 'SQLSERVER_InstanceName',
        'PORT': '',
        'USER': 'SQLSERVERUSER',
        'PASSWORD': 'USER's PASSWORD',
         'DATABASE': 'MY_DATABASE',
         # 'Trusted_Connection': 'Yes',
        # 'OPTIONS': {
        #             'driver': 'ODBC Driver 11 for SQL Server',
        #            }

            },
}
}}}

But when I install django-pyodbc-azure and try to run the above code by running python manage.py inspectdb command, it works.

But the problem with using django-pyodbc-azure is that it downgrades the current version of django to 2.0.8 version - which I do not want.

I do not want to use FreeTDS or Pymssql. I want to go with pyodbc only.

Can someone please suggest some way for this?"	Uncategorized	closed	Database layer (models, ORM)	2.1	Normal	invalid		gurmeet.kaur@… gurmeetkaurjuneja23@…	Unreviewed	0	0	0	0	0	0
