Amitkumar Satpute
Amitkumar Satpute

Reputation: 144

How to connect Sqlserver 2008 in Django?

DATABASES = {
    'default': {
    'NAME': 'CVH_Dev',
    'ENGINE': 'sqlserver_ado',
    'HOST': '127.0.0.1',
    'USER': '',
    'PASSWORD': '',
    'OPTIONS': {
        'provider': 'SQLOLEDB',
        'use_legacy_date_fields': 'True'
    }
}

I was tried above code . but it shows error message.

Error Messgae: File "C:\Python27\lib\site-packages\django\db\utils.py", line 134, in load_backend raise ImproperlyConfigured(error_msg) django.core.exceptions.ImproperlyConfigured: 'sqlserver_ado' isn't an available database backend. Try using 'django.db.backends.XXX', where XXX is one of: 'mysql', 'oracle', 'postgresql', 'sqlite3' Error was: No module named util

please tell me how to connect SQL server 2008 to my django project.. now I m using SQL server2008R2

Upvotes: 0

Views: 666

Answers (2)

Shashishekhar Hasabnis
Shashishekhar Hasabnis

Reputation: 1756

From the code that I see you are trying to use third party package Django MSSQL which needs these settings. To make these settings available for Django you first need to:-

pip install django-mssql 

For further reference you can read:- http://django-mssql.readthedocs.io/en/latest/quickstart.html

Upvotes: 0

Django doesn't support MSSql out of the box. I would suggest trying an external package, like django-mssql.

Upvotes: 1

Related Questions