title: flask+uwsgi+supervisor set environment variable
body: <p>I'm using <code>flask</code> with <code>uwsgi</code> to connect with <code>nginx</code>.</p>
  
  <p>Also used <code>supervisor</code> to daemonize uwsgi.</p>
  
  <p>In flask source, to get environment variable, use this code.</p>
  
  <p><code>os.getenv('FLASK_CONFIGURATION') or 'development'</code></p>
  
  <p>And in my .bashrc, I set environment variable like this.</p>
  
  <pre><code>export FLASK_CONFIGURATION=production
  export NEWRELIC_KEY=12345
  </code></pre>
  
  <p>But it still works with <code>development</code>.</p>
  
  <p>Refer the google, uwsgi launch isolated with bash, so it can't read environment varible.</p>
  
  <p>So I set variable to uwsgi.</p>
  
  <pre><code>FLASK_CONFIGURATION = $(FLASK_CONFIGURATION)
  NEWRELIC_KEY = $(NEWRELIC_KEY)
  </code></pre>
  
  <p>But it still doesn't work.</p>
  
  <p>Is there any solution here?</p>