title: Transferring django settings to Environment Variables
body: <p>I set the django project settings and added values to environment variables at my local ubuntu mashine and AWS Ubuntu server using <code>.bashrc</code> file at the root folder. </p>
  
  <pre><code>...
  export DEBUG="True"
  ...
  </code></pre>
  
  <p><strong>settings.py</strong></p>
  
  <pre><code>...
  SECRET_KEY = os.environ.get('SECRET_KEY')
  DEBUG = os.environ.get('DEBUG', False)
  ...
  </code></pre>
  
  <p>At local all working good, but at production server values are not importing. Why doesn't it work on both machines? How do I set up production?</p>
  
  <p>Im running production server using asgi server daphne, accordingly this  <a href="https://channels.readthedocs.io/en/latest/deploying.html" rel="nofollow noreferrer">tutorial</a></p>
  
  <p><strong>upd</strong></p>
  
  <p><strong>asgi.py</strong></p>
  
  <pre><code>import os
  import django
  from channels.routing import get_default_application
  
  os.environ.setdefault("DJANGO_SETTINGS_MODULE", "myapp.settings")
  django.setup()
  application = get_default_application()
  </code></pre>