title: How to set an environment variable in Amazon Elastic Beanstalk (Python)
body: <p>I have been working on a Django application lately, trying to get it to work with Amazon Elastic Beanstalk.</p>
  
  <p>In my <code>.ebextensions/python.config</code> file, I have set the following:</p>
  
  <pre><code>option_settings:
    - namespace: aws:elasticbeanstalk:application:environment
      option_name:  ProductionBucket
      value: s3-bucket-name
    - namespace: aws:elasticbeanstalk:application:environment
      option_name:  ProductionCache
      value:  memcached-server.site.com:11211
  </code></pre>
  
  <p>However, whenever I look on the server, no such environment variables are set (and as such, aren't accessible when I try <code>os.getenv('ProductionBucket')</code></p>
  
  <p>I came across this <a href="https://gist.github.com/808968">this page</a> which appears to attempt to document all the namespaces. I've also tried using <code>PARAM1</code> as the option name, but have had similar results.</p>
  
  <p>How can I set environment variables in Amazon Elastic Beanstalk?</p>
  
  <p><strong>EDIT</strong>:<br>
  I have also tried adding a command prior to all other commands which would just export an environment variable:</p>
  
  <pre><code>commands:
   01_env_vars:
    command: "source scripts/env_vars"
  </code></pre>
  
  <p>... This was also unsuccessful</p>