trying to configure MSSQL 2012 as backend with Django.

59 views
Skip to first unread message

sarfaraz ahmed

unread,
Jun 15, 2014, 2:35:20 PM6/15/14
to django...@googlegroups.com
Hello Friends,

I am trying to moving away from sqlite. Trying to use MS SQl 2012 as backend. So far I installed django-mssql on my machine. When I type import sqlserver_ado... It works fine. 

I am new to Django. Please provide me with example to get my MSSQL connected to django. More than one example will be appreciated. I check lot of post however but i am unable find any solution. With proper example. 

Thanks in advance.

Regards,
Sarfaraz Ahmed

Mark Phillips

unread,
Jun 15, 2014, 3:27:35 PM6/15/14
to django users


--
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...@googlegroups.com.
To post to this group, send email to django...@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/61f97c7b-6f0f-4132-92ad-a3d986c7fb7f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

sarfaraz ahmed

unread,
Jun 15, 2014, 3:41:29 PM6/15/14
to django...@googlegroups.com
Yes, I saw and tried the steps mentioned in that link. I get following error 

"No module named sqlserver_ado.base". 

This is lines in setting.py Please help

DATABASES = {
    'default': {
        'NAME': 'blogger',
        'ENGINE': 'django.db.backends.sqlserver_ado',
        'HOST': ' ',
        'USER': 'sa',
        'PASSWORD': '*****',
    }
}
I am  new to DJANGO... 

Regards,
Sarfaraz Ahmed



For more options, visit https://groups.google.com/d/optout.



--
Thanks with regards,
Sarfaraz Ahmed


sarfaraz ahmed

unread,
Jun 15, 2014, 4:04:21 PM6/15/14
to django...@googlegroups.com
Thanks for your help. The issue is resolved ... thanks :)

Ezequiel Bertti

unread,
Jun 15, 2014, 5:33:45 PM6/15/14
to django...@googlegroups.com
What was the solution?



For more options, visit https://groups.google.com/d/optout.



--
Ezequiel Bertti
E-Mail: ebe...@gmail.com
Cel: (21) 99188-4860

VÁ PARA BÚZIOS!!!
http://www.agh.com.br/
Ane Guest House

Michael Manfre

unread,
Jun 16, 2014, 9:38:10 AM6/16/14
to django...@googlegroups.com
From looking at the configuration that was posted, the solution was likely to remove  "django.db.backends." from the ENGINE. That prefix is only for backends that are included with Django.

Regards,
Michael Manfre

sarfaraz ahmed

unread,
Jun 17, 2014, 3:59:41 AM6/17/14
to django...@googlegroups.com

Hello Ezequiel

I have a database in SQL Server 2012. I used the following string and everything worked.. find. Trust me I am new to django and feeling good to be part of this community.

DATABASES = {
    'default': {
        'NAME': 'blogger',
        'ENGINE': 'sqlserver_ado',
        'HOST': ' ',
        'USER': 'sa',
        'PASSWORD': '******', # used actual password
        'OPTIONS' : {
            'provider': 'SQLNCLI11',
            'extra_params' : 'DataTypeCompatibility=80;MARS Connection=True'
        }
    }
}



For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages