title: Django Postgresql Configuration ERROR : ImproperlyConfigured: settings.DATABASES
body: <p>A newbie to Django!!</p>
  
  <p>In the process of switching from sqlite3 to postgresql,
  I tried to follow the steps in the link.</p>
  
  <blockquote>
    <p><a href="http://www.marinamele.com/taskbuster-django-tutorial/install-and-configure-posgresql-for-django" rel="nofollow">http://www.marinamele.com/taskbuster-django-tutorial/install-and-configure-posgresql-for-django</a></p>
  </blockquote>
  
  <p>settings.py (added Database settings as follows)</p>
  
  <pre><code>DATABASES = {
      'default': {
          'ENGINE': 'django.db.backends.postgresql_psycopg2',
          'NAME': get_env_variable('DATABASE_NAME'),
          'USER': get_env_variable('DATABASE_USER'),
          'PASSWORD': get_env_variable('DATABASE_PASSWORD'),
          'HOST': '',
          'PORT': '',
      }
  }
  def get_env_variable(var_name):
      try:
          return os.environ[var_name]
      except KeyError:
          error_msg = "Set the %s environment variable" % var_name
          raise ImproperlyConfigured(error_msg)
  </code></pre>
  
  <blockquote>
    <p>In Django shell</p>
  </blockquote>
  
  <pre><code>&gt;&gt;&gt;from trydjango import settings
  &gt;&gt;&gt;settings.DATABASES
  {'default': {'ENGINE': 'django.db.backends.dummy', 'AUTOCOMMIT': True,
  'ATOMIC_REQUESTS': False, 'NAME': '', 'CONN_MAX_AGE': 0, 'TIME_ZONE':    None, 
  'PORT': '', 'HOST': '', 'USER': '', 
  'TEST': {'COLLATION': None, 'CHARSET': None, 'NAME': None, 'MIRROR': None}, 
  'PASSWORD': '', 'OPTIONS': {}}}
  </code></pre>
  
  <blockquote>
    <p>ERROR :</p>
  </blockquote>
  
  <pre><code>django.core.exceptions.ImproperlyConfigured:settings.DATABASES is improperly configured. 
  Please supply the ENGINE value. Check settings documentation 
  for more details.
  </code></pre>
  
  <p>Please help me out to solve this.</p>