title: Deploying to Heroku with untracked .env file
body: <p>I am having trouble deploying my Django application on Heroku.</p>
  
  <p>The problem occurs because I am using the <a href="https://pypi.python.org/pypi/python-decouple" rel="nofollow noreferrer"><code>python-decouple</code> library</a>. I am using it so as not to expose my <code>API_KEYS</code>.</p>
  
  <p>This is the error I am getting:</p>
  
  <pre><code>  File "/app/weather/settings.py", line 20, in &lt;module&gt;
      API_KEY = config('API_KEY')
    File "/app/.heroku/python/lib/python3.6/site-packages/decouple.py", line 197, in __call__
       return self.config(*args, **kwargs)
    File "/app/.heroku/python/lib/python3.6/site-packages/decouple.py", line 85, in __call__
      return self.get(*args, **kwargs)
    File "/app/.heroku/python/lib/python3.6/site-packages/decouple.py", line 70, in get
      raise UndefinedValueError('{} not found. Declare it as envvar or define a default value.'.format(option))
  decouple.UndefinedValueError: API_KEY not found. Declare it as envvar or define a default value.
  </code></pre>
  
  <p>I have stored all the variables in <code>BASE_DIR + '/.env'</code> file and added this file to my <code>.gitignore</code> file.</p>
  
  <p>What is the solution to this problem?</p>