Cannot get environment variables in Django settings file

送分小仙女□ 提交于 2019-11-29 06:12:46

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:

  1. Use apache SetEnv directive in your virtualhost config,
  2. Set the environment variables for the user that apache runs your code as, or
  3. Tell apache to run the wsgidaemon process as your user.
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!