title: How do I pass env variables to uwsgi?
body: <p>I have a WSGI handler configured under Apache and I'm defining some environmental variables in the Apache virtual host configuration.</p>
  
  <pre><code>SetEnv APP_CONFIG "/var/lib/myapp/app.config"
  SetEnv LOG_CONFIG "/var/lib/myapp/app.logging.yml"
  </code></pre>
  
  <p>To test the handler in development without having to install and configure Apache I'm using <code>uWSGI</code> with the <code>--http</code> option.</p>
  
  <pre><code>uwsgi --http :9090 --ini uwsgi.ini --wsgi-file wsgi.py
  </code></pre>
  
  <p>wsgi.py</p>
  
  <pre><code>def application(environ, start_response):
      config_file_path = environ['APP_CONFIG']
      start_response('200 OK', [('Content-Type','text/html')])
      return ["Hello World"]
  </code></pre>
  
  <p>Using the uWSGI http server how can I pass these variables to my application as part of the <code>environ</code> argument?</p>
  
  <p>I have tried setting environmental variables in the uwsgi.ini file:</p>
  
  <pre><code>[uwsgi]
  env = APP_CONFIG="/var/lib/myapp/app.config"
  </code></pre>
  
  <p>but I get:</p>
  
  <pre><code>File "wsgi.py", line 5, in application
  config_file_path = environ['APP_CONFIG']
  KeyError: 'APP_CONFIG'
  </code></pre>