Earlier i had a problem with my pyodbc module, that did not run my application on the apache server, running on my windows machine. I found to solve my problem of getting the django project to run on apache using this hint.
But now I am facing a bit of a different problem. The django application runs on apache but throws this error on the page.
ImproperlyConfigured at /auth/login/
settings.DATABASES is improperly configured. Please supply the ENGINE value. Check settings documentation for more details.
Just to be clear, this project runs perfectly when deployed through djangos inbuilt server. This is how my database connection looks like in the settings.py
DATABASES = {
'default': {
'ENGINE': 'sql_server.pyodbc',
'NAME': 'myDbName',
'USER': 'myusername',
'PASSWORD': '',
'HOST': '',
'OPTIONS' : {
'driver': 'SQL Native Client',
'dsn': 'test',
'MARS_Connection': True,
},
},
}
UPDATE:
I updated my code according to Django MSSQL Documentation, ran into a few problems and got it to work by updating my pywin32 And again this works on djangos inbuilt server and NOT APACHE giving me the same ImproperlyConfigured error
DATABASES = {
'default': {
'NAME': 'myDbName',
'ENGINE': 'sqlserver_ado',
'HOST': 'MYHOST',
'USER': 'myusername',
'PASSWORD': 'mypassword',
'OPTIONS' : {
'provider': 'SQLNCLI11',
'use_mars': False,
},
}
}
My system – Windows 7, Apache 2.2, python 2.7, django 1.4.2, pyodbc-3.0.6.win32-py2.7
Any hints or tips towards this is highly appriciated, i ahve been trying to get this project up and running for quite some time now.
Thanks alot
The answer to my question might be a bit wierdbut hey this is how i got things to work on my machine.
The main problem I had was that my DSN was not getting connected with the django project, in the steps I have mentioned below, its the last step that made the whole difference in making it work. Previously I had selected “With integrated Windows authentication” while creating my DSN, but surprisingly it worked when I was running it using djangos inbuilt server.
And i changed my database connection back to the original code
Thanks to all who helped me solve this, and hope this is helpfull for someone out there.
Cheers