title: Django 1.4.2 / South 0.7.6 database error - DEFAULT_DB_ALIAS
body: <p>When I run <code>python manage.py runserver</code> I get the following error:</p>
  
  <pre><code>Unhandled exception in thread started by &lt;bound method Command.inner_run of &lt;django.contrib.staticfiles.management.commands.runserver.Command object at 0x1cc9cd0&gt;&gt;
  Traceback (most recent call last):
    File "/usr/local/lib/python2.7/dist-packages/django/core/management/commands/runserver.py", line 91, in inner_run
      self.validate(display_num_errors=True)
    File "/usr/local/lib/python2.7/dist-packages/django/core/management/base.py", line 266, in validate
      num_errors = get_validation_errors(s, app)
    File "/usr/local/lib/python2.7/dist-packages/django/core/management/validation.py", line 30, in get_validation_errors
      for (app_name, error) in get_app_errors().items():
    File "/usr/local/lib/python2.7/dist-packages/django/db/models/loading.py", line 158, in get_app_errors
      self._populate()
    File "/usr/local/lib/python2.7/dist-packages/django/db/models/loading.py", line 64, in _populate
      self.load_app(app_name, True)
    File "/usr/local/lib/python2.7/dist-packages/django/db/models/loading.py", line 88, in load_app
      models = import_module('.models', app_name)
    File "/usr/local/lib/python2.7/dist-packages/django/utils/importlib.py", line 35, in import_module
      __import__(name)
    File "/usr/local/lib/python2.7/dist-packages/South-0.7.6-py2.7.egg/south/models.py", line 2, in &lt;module&gt;
      from south.db import DEFAULT_DB_ALIAS
    File "/usr/local/lib/python2.7/dist-packages/South-0.7.6-py2.7.egg/south/db/__init__.py", line 81, in &lt;module&gt;
      db = dbs[DEFAULT_DB_ALIAS]
  KeyError: 'default'
  </code></pre>
  
  <p>Here is my <strong>settings.py</strong>:</p>
  
  <pre><code> DATABASES = {
      'default': {
          'ENGINE': 'django.db.backends.postgresql_psycopg2',
          'NAME': 'foureggs',
          'USER': 'myuser',
          'PASSWORD': 'mypass',
          'HOST': '',
          'PORT': '',
      }
  }
  </code></pre>
  
  <p>Here is a <a href="https://stackoverflow.com/questions/10058035/south-django-1-4-database-error">question</a> with the same problem. The answer says that "there should be a database named 'default' in your settings". I'm not really following that. My db name is "foureggs" so I want to use that, obviously.</p>
  
  <p><strong>UPDATE:</strong> When I do <code>python manage.py diffsettings</code> I get the following output, which <strong>doesn't look correct</strong> (pasting only the relevant DATABASE line, the rest of the settings look OK):</p>
  
  <pre><code>DATABASES = {'default': {'ENGINE': 'django.db.backends.dummy', 'TEST_MIRROR': None, 'NAME': '', 'TEST_CHARSET': None, 'TIME_ZONE': 'UTC', 'TEST_COLLATION': None, 'PORT': '', 'HOST': '', 'USER': '', 'TEST_NAME': None, 'PASSWORD': '', 'OPTIONS': {}}}
  </code></pre>
  
  <p>I have only one settings file in my project and it's in the app directory, which is correct. Where does the above DATABASE line come from?</p>
  
  <p><strong>UPDATE 2: I figured out what's the problem</strong>. It's these 2 extra lines I put to <code>settings.py</code> as instructed by <a href="https://devcenter.heroku.com/articles/django#database-settings" rel="nofollow noreferrer">Heroku deployment guide</a>. When I comment them out, everything works fine. Now I need to figure out why it's causing the problem.</p>
  
  <pre><code># Parse database configuration from $DATABASE_URL
  import dj_database_url
  DATABASES['default'] =  dj_database_url.config()
  </code></pre>