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?
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 <matthew.p...@gmail.com> wrote:
> 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?
> --
> You received this message because you are subscribed to the Google Groups "modwsgi" group.
> To post to this group, send email to modwsgi@googlegroups.com.
> To unsubscribe from this group, send email to modwsgi+unsubscribe@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/modwsgi?hl=en.
After spending days debugging this issue, I am a bit embarrassed to say what the problem was, but I think it's a good idea to explain what happened as a matter of completeness.
I had two django project folders established: one for the production and one for the development. I forgot to clean up the production project folder to properly match the development project folder. In the production project folder, I had a settings.py file, but I also I had a settings folder when I was experimenting with a different way of initializing settings. In that experiment, DEBUG was always TRUE in the __init__.py file in the settings folder. After deleting the settings folder, the application worked as expected.
Thank you very much for all of your assistance in this matter! --Matthew