Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9207339
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T00:21:58+00:00 2026-06-18T00:21:58+00:00

When I run python manage.py runserver I get the following error: Unhandled exception in

  • 0

When I run python manage.py runserver I get the following error:

Unhandled exception in thread started by <bound method Command.inner_run of <django.contrib.staticfiles.management.commands.runserver.Command object at 0x1cc9cd0>>
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 <module>
    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 <module>
    db = dbs[DEFAULT_DB_ALIAS]
KeyError: 'default'

Here is my settings.py:

 DATABASES = {
    'default': {
        'ENGINE': 'django.db.backends.postgresql_psycopg2',
        'NAME': 'foureggs',
        'USER': 'myuser',
        'PASSWORD': 'mypass',
        'HOST': '',
        'PORT': '',
    }
}

Here is a question 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.

UPDATE: When I do python manage.py diffsettings I get the following output, which doesn’t look correct (pasting only the relevant DATABASE line, the rest of the settings look OK):

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': {}}}

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?

UPDATE 2: I figured out what’s the problem. It’s these 2 extra lines I put to settings.py as instructed by Heroku deployment guide. When I comment them out, everything works fine. Now I need to figure out why it’s causing the problem.

# Parse database configuration from $DATABASE_URL
import dj_database_url
DATABASES['default'] =  dj_database_url.config()
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-18T00:21:59+00:00Added an answer on June 18, 2026 at 12:21 am

    The problem is apparently not related to South, but to the DB backend.

    1. you may start from here: "settings.DATABASES is improperly configured" error performing syncdb with django 1.4 and related questions

    2. If the aforementioned answers not work, first of all check if psycopg2 library is installed and in your sys.path: if not please install it Psycopg2 library install instructions here.

    3. then you can eventually change your ENGINE setting to: ‘postgresql_psycopg2’; in this way you can bypass the built-in engine if for any reason it will not work.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

When I try to run sudo ./manage.py runserver , I get the following error:
When I try and run django, this is what I get: /System/Library/Frameworks/Python.framework/Versions/2.7/bin/python manage.py runserver
If I run the following command: >python manage.py test Django looks at tests.py in
I run at a cloned Django repository python manage.py runserver I get Traceback (most
When I run: python manage.py runserver The development server starts up with no error
When I view my Django admin (after firing up the python manage.py runserver command),
I want to run manage.py sqldiff myapp (command from django extension), but I get
I get the following error trying to run the Django development server. I'm using
I want to run a command just before the a django command is started.
When I run python manage.py shell , I can print out the python path

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.