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?


Thanks,
Gurmeet Kaur

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAEbKJVinxbK8KMVdUH74kxkGC%3DNv1FCU3H4B9w7HYznM8-DQLg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to