Ask Your Question
0

Problem with syncdb (KeyError: 'default')

asked 2012-04-05 15:36:48 -0600

aaronmorse gravatar image

updated 2012-04-05 16:26:59 -0600

Evgeny gravatar image

Hello, I'm new to askbot but I'm trying to mirror a setup we (my company) already has here and I run into a problem with the 'python manage.py syncdb' command. By mirror I mean we have a system running the same setup and I'm just trying to duplicate it from scratch on a new machine. My setup is:
CentOS5 (yeah, I know)
askbot 0.7.20
django 1.1.4
postgresql 8.3.18
python 2.6.5
Everything is installed in a virtualenv /home/user/askbot-install/bin and I ran askbot-setup pointing to /home/user/askbot-install/deploy. The output from the syncdb attempt I get is below. I tried removing/changing the ADMIN_MEDIA_PREFIX but then it just skips that warning. I feel like I'm missing something dumb. thoughts? Thanks.

python manage.py syncdb
/home/postgres/askbot-install/lib/python2.6/site-packages/django/conf/__init__.py:75: DeprecationWarning: The ADMIN_MEDIA_PREFIX setting has been removed; use STATIC_URL instead.
  "use STATIC_URL instead.", DeprecationWarning)
/home/postgres/askbot-install/lib/python2.6/site-packages/django/core/cache/__init__.py:82: DeprecationWarning: settings.CACHE_* is deprecated; use settings.CACHES instead.
  DeprecationWarning
Traceback (most recent call last):
  File "manage.py", line 11, in <module>
    execute_manager(settings)
  File "/home/postgres/askbot-install/lib/python2.6/site-packages/django/core/management/__init__.py", line 459, in execute_manager
    utility.execute()
  File "/home/postgres/askbot-install/lib/python2.6/site-packages/django/core/management/__init__.py", line 382, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "/home/postgres/askbot-install/lib/python2.6/site-packages/django/core/management/__init__.py", line 261, in fetch_command
    klass = load_command_class(app_name, subcommand)
  File "/home/postgres/askbot-install/lib/python2.6/site-packages/django/core/management/__init__.py", line 69, in load_command_class
    module = import_module('%s.management.commands.%s' % (app_name, name))
  File "/home/postgres/askbot-install/lib/python2.6/site-packages/django/utils/importlib.py", line 35, in import_module
    __import__(name)
  File "/home/postgres/askbot-install/lib/python2.6/site-packages/south/management/commands/__init__.py", line 13, in <module>
    from south.management.commands.syncdb import Command as SyncCommand
  File "/home/postgres/askbot-install/lib/python2.6/site-packages/south/management/commands/syncdb.py", line 17, in <module>
    from south.db import dbs
  File "/home/postgres/askbot-install/lib/python2.6/site-packages/south/db/__init__.py", line 78, in <module>
    db = dbs[DEFAULT_DB_ALIAS]
KeyError: 'default'

edit retag flag offensive close merge delete

Comments

I think your cloning was not perfect, there must be different versions of libraries, possibly django.

Evgeny gravatar imageEvgeny ( 2012-04-05 16:47:45 -0600 )edit

1 Answer

Sort by ยป oldest newest most voted
0

answered 2012-04-05 16:25:09 -0600

Evgeny gravatar image

Not sure what is the cause of this. Maybe your version of django is 1.4.x? With django 1.4 format of settings for the database is a bit different.

I'll try to make a release today that fixes django version to 1.3 until we change the settings style, but you could try just downgrading of django.

edit flag offensive delete link more

Comments

Great, thanks. As it turns out I am actually using django 1.4. I thought I was running 1.1.x. Python 2.6.5 (r265:79063, Feb 28 2011, 21:55:56) [GCC 4.1.2 20080704 (Red Hat 4.1.2-50)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import django >>> django.VERSION (1, 4, 0, 'final', 0) >>>

aaronmorse gravatar imageaaronmorse ( 2012-04-06 04:04:19 -0600 )edit

Downgrading to django 1.2 allowed the syncdb to get further. I'm now getting a "relation "askbot_emailfeedsetting" does not exist" error after setting up the superuser but I'll look into that. Thanks for the help.

aaronmorse gravatar imageaaronmorse ( 2012-04-06 07:30:15 -0600 )edit

Try starting with a blank database.

Evgeny gravatar imageEvgeny ( 2012-04-06 09:51:46 -0600 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2012-04-05 15:36:48 -0600

Seen: 2,453 times

Last updated: Apr 05 '12