title: How do I use .env in Django?
body: <p>My goal is to email using Python Django without having my email password being shown in the actual code. After some research, I guess I can store my password in an .env file and then access the password from the .env file. So, I currently have an .env file in my Django project with this line of code:</p>
  <pre><code>export EMAIL_HOST = 'smtp.gmail.com'
  </code></pre>
  <p>And in my settings.py, I have these:</p>
  <pre><code>import environ
  env = environ.Env()
  environ.Env.read_env()
  EMAIL_HOST = os.environ.get('EMAIL_HOST')
  print(EMAIL_HOST)
  </code></pre>
  <p>But the printed result is None. print(os.environ) spits out something though. How can I get my .env file to work?</p>