title: Set the DATABASE_URL environment variable
body: <p>I am trying to create my own kind of project structure by looking at two scoops of django. The project structure looks something like this </p>
  
  <p>.<strong>envs</strong></p>
  
  <p>.<strong>local</strong></p>
  
  <pre><code>  .django
  
    .postgres
  </code></pre>
  
  <p><strong>.production</strong></p>
  
  <pre><code> .django
  
   .postgres
  </code></pre>
  
  <p>in postgres inside local, the following items are listed </p>
  
  <pre><code>POSTGRES_HOST=postgres
  POSTGRES_PORT=5432
  POSTGRES_DB=marketing
  POSTGRES_USER=username
  POSTGRES_PASSWORD=password
  DATABASE_URL=postgres://username:password@localhost:5432/marketing
  </code></pre>
  
  <p>the settings file is divided into 3 parts as <code>base.py, local.py and production.py</code> </p>
  
  <p>in base.py, I have configured the <code>DATABASES</code> key as following</p>
  
  <pre><code>DATABASES = {
      'default': env.db('DATABASE_URL'),
  }
  </code></pre>
  
  <p>However I am getting an error </p>
  
  <blockquote>
    <p>django.core.exceptions.ImproperlyConfigured: Set the DATABASE_URL
    environment variable</p>
  </blockquote>
  
  <p>Though, I have <code>DATABASE_URL</code> in .envs/.local/.postgres, I am getting above error. Why is that so? </p>