I can actually help you here.

I had the same problem and tried 4 different modules.
The only module that works with sql server is 

https://github.com/michiya/django-pyodbc-azure


I am running it both on windows and linux, simultaneously.


The settings components are displayed on the web site.

Works like a charm

One dependency is pyodbc to be installed.



On Wednesday, December 10, 2014 4:22:44 AM UTC-5, Sugita Shinsuke wrote:
>
> Hi there.
>
> Could you tell me a good way to use Django with Micro Soft DB SQL server. I 
> tried django_pyodbc. Any suggestion is appreciated.
>
> my PC of Environment is below.
>
> Database:
> SQL Server 2014 Express
>
> OS:
> Windows 7 Home Premium SP1
>
> I used the django module, django_pyodbc.
> And, I tried to run syncdb but I couldn't.
>
> My settings.py is below.
>
> DATABASES = {
>    'default': {
>        'ENGINE': "django_pyodbc",
>        'HOST': "localhost",
>        'USER': "djangouser",
>        'PASSWORD': "xxxxx",
>        'NAME': "db_test",
>        'OPTIONS': {
>             'host_is_server': True,
>             'autocommit': True,
>             'unicode_results': True,
>             'extra_params': 'tds_version=8.0'
>         },
>    }
> }
>
> Things I tried and did not work:
> 1,change "localhost" to "127.0.0.1,1433" in the HOST property of the code.
> 2,removed 'OPTIONS'.
>
>
> However, I tried the module pyodbc of pure python like below. It was fine.
>
> ---
> conn = pyodbc.connect('driver={SQL 
> Server};server=localhost;UID=djangouser;PWD=xxxxx;DATABASE=shannon_test;Trusted_Connection=yes')
> ---
>
> But, DB connection is not established without "Trusted_Connection=yes".
> At least I do not know any other way. Anyone who know this matter, please 
> help.
>
>
>
> The error message is here.
>
> ----
>
> pyodbc.ProgrammingError: ('42000', '[42000] [Microsoft][ODBC SQL Server 
> Driver][
> SQL 
> Server]\x82\xb1\x82\xcc\x83\x8d\x83O\x83C\x83\x93\x82\xc5\x97v\x8b\x81\x82\x
> b3\x82\xea\x82\xbd\x83f\x81[\x83^\x83x\x81[\x83X "shannon_test" 
> \x82\xf0\x8aJ\x8
> 2\xaf\x82\xdc\x82\xb9\x82\xf1\x81B\x83\x8d\x83O\x83C\x83\x93\x82\xc9\x8e\xb8\x94
> s\x82\xb5\x82\xdc\x82\xb5\x82\xbd\x81B (4060) (SQLDriverConnect); [01S00] 
> [Micro
> soft][ODBC SQL Server 
> Driver]\x90\xda\x91\xb1\x95\xb6\x8e\x9a\x97\xf1\x82\xcc\x9
> 1\xae\x90\xab\x82\xaa\x90\xb3\x82\xb5\x82\xad\x82\xa0\x82\xe8\x82\xdc\x82\xb9\x8
> 2\xf1\x81B (0); [42000] [Microsoft][ODBC SQL Server Driver][SQL 
> Server]\x82\xb1\
> x82\xcc\x83\x8d\x83O\x83C\x83\x93\x82\xc5\x97v\x8b\x81\x82\xb3\x82\xea\x82\xbd\x
> 83f\x81[\x83^\x83x\x81[\x83X "shannon_test" 
> \x82\xf0\x8aJ\x82\xaf\x82\xdc\x82\xb
> 9\x82\xf1\x81B\x83\x8d\x83O\x83C\x83\x93\x82\xc9\x8e\xb8\x94s\x82\xb5\x82\xdc\x8
> 2\xb5\x82\xbd\x81B (4060); [01S00] [Microsoft][ODBC SQL Server 
> Driver]\x90\xda\x
> 91\xb1\x95\xb6\x8e\x9a\x97\xf1\x82\xcc\x91\xae\x90\xab\x82\xaa\x90\xb3\x82\xb5\x
> 82\xad\x82\xa0\x82\xe8\x82\xdc\x82\xb9\x82\xf1\x81B (0)')
> ----
>
>
>

-- 
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 http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/75829654-59e0-4ba5-a824-8a61123387c7%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to