Hi Mate,

I had the same issues with connecting to MS SQL.
This is the configuration which worked for me...

DATABASES = {
    'default': {
        'ENGINE': 'sql_server.pyodbc',
        'HOST': 'XXX',
        'PORT': '1433',

        'USER': 'XXX',
        'PASSWORD': 'XXX',
        'NAME': 'XXX', #name of your table
        'CONN_MAX_AGE': 0,
        'AUTOCOMMIT': True,

        'OPTIONS': {
            'driver': 'ODBC Driver 17 for SQL Server',
            'host_is_server': True,
            'autocommit': True,
            'driver_needs_utf8': True,
            'use_legacy_date_fields' : True,
        },
    }
}
You need to have pyodbc installed.

BR,
Ivan

On Sunday, January 6, 2019 at 6:56:09 PM UTC+1, Praveen Kumar wrote:
>
> Hi All,
>
> Changed DATABASE code as under in setting.py in Django project. But not 
> getting able to connect to MS SQL Server. Please suggest.
>
> ATABASES = {
>     'default': {
>         'NAME': 'APJ_AIM_LITE',
>         'ENGINE': 'sqlserver_ado',
>         'HOST': 'DB_SERVER',
>         'USER': '',
>         'PASSWORD': '',
>     }
> }
>

-- 
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 django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
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/c8366067-faf8-426a-b6d1-3b0e37a35e15%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to