title: Django ignoring environment variables when run via uWSGI
body: <p>I have a django website, that uses an environment variable, <code>DJANGO_MODE</code> to decide which settings to use - development or staging. The environment variable is in the <code>bashrc</code> and when running the app using the development server, everything works fine.</p>
  
  <p>But when I run the app using <code>uWSGI</code>, it doesn't seem to notice the environment variable and uses the default(development) settings instead of production.</p>
  
  <p>I run <code>uWSGI</code> in Emperor mode, and other than the environment variable ignoring, everything seems to be running fine. And yes, the user running <code>uWSGI</code> is the same for which the <code>bashrc</code> has <code>DJANGO_MODE</code> set.</p>
  
  <p>The command used to run <code>uWSGI</code> is -</p>
  
  <pre><code>exec  uwsgi --emperor /etc/uwsgi/vassals --uid web_user --gid --web_user
  </code></pre>
  
  <p>And the <code>ini</code> file for the vassal -</p>
  
  <pre><code>[uwsgi]
  processes = 2
  socket = /tmp/uwsgi.sock
  wsgi-file = /home/web_user/web/project_dir/project/wsgi.py
  chdir = /home/web_user/web/project_dir
  virtualenv = /home/web_user/.virtualenvs/production_env
  logger = syslog
  chmod-socket = 777
  </code></pre>