You need to specify, with any error messages you get, what 'it doesn't work as expected on the Apache/mod_wsgi server' means.
A few points to note. 1. Web application under Apache would run in a different user to when you run it manually. 2. The Apache environment doesn't inherit environment variables from your user account. 3. The user code runs as may not have access to directories you would when run yourself. 4. The application will not have same working directory, so paths must be absolute not relative. Graham On 7 May 2012 07:54, Bobort <[email protected]> wrote: > Hello, > > I have been scouring all over to figure out what is wrong with my > configuration, and it's probably something simple I have overlooked. > I'm developing a Django application that will run on Apache/mod_wsgi. > In my settings.py file, I set the DATABASES variable and the DEBUG > variable depending on if the website is running from the development > machine. > > The code works as expected on the Django development server; DEBUG > gets FALSE. However, it doesn't work as expected on the Apache/ > mod_wsgi server; DEBUG gets TRUE. What am I doing wrong? Am I even > at the right group to ask this question? > > Thank you very much! > > This is what I have: > > import socket > if socket.gethostname()=='IT': > DEBUG = True > DATABASES = { > 'default': { > 'NAME': 'dev_database', > 'ENGINE': 'sqlserver_ado', > 'HOST': 'server\\SQLSERVER', > 'USER': '', > 'PASSWORD': '', > 'OPTIONS': { > 'provider': 'SQLOLEDB', > 'use_mars': True, > }, > } > } > else: > DEBUG = False > DATABASES = { > 'default': { > 'NAME': 'live_database', > 'ENGINE': 'sqlserver_ado', > 'HOST': 'server\\SQLSERVER', > 'USER': '', > 'PASSWORD': '', > 'OPTIONS': { > 'provider': 'SQLOLEDB', > 'use_mars': True, > }, > } > } > > -- > You received this message because you are subscribed to the Google Groups > "modwsgi" group. > To post to this group, send email to [email protected]. > To unsubscribe from this group, send email to > [email protected]. > For more options, visit this group at > http://groups.google.com/group/modwsgi?hl=en. > -- You received this message because you are subscribed to the Google Groups "modwsgi" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/modwsgi?hl=en.
