Cannot get environment variables in Django settings file
I've manage to solve my problem by using this solution:
http://drumcoder.co.uk/blog/2010/nov/12/apache-environment-variables-and-mod_wsgi/
I've just recently found the cause of this myself.
When running under apache/mod_wsgi, your application runs under a different user, so those environment variables are not set. Your options are:
- Use apache SetEnv directive in your virtualhost config,
- Set the environment variables for the user that apache runs your code as, or
- Tell apache to run the wsgidaemon process as your user.