Forums

Python 3.3 Django 1.6 South error on syncdb

I'm setting up a new web app, I used the default config for Python3 and Django 1.6. I installed the connector as advised in the help pages. I'm getting the error below when I try to do the initial syncdb for South to start working.

Beginning of DATABASES definition looks correct:

DATABASES = {
    'default': {
        'ENGINE': 'mysql.connector.django', 
...

Full error message and traceback:

Traceback (most recent call last):
File "./manage.py", line 10, in <module>
execute_from_command_line(sys.argv)
File "/usr/local/lib/python3.3/dist-packages/django/core/management/__init__.py", line 399, in execute_from_command_line
utility.execute()
File "/usr/local/lib/python3.3/dist-packages/django/core/management/__init__.py", line 392, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/usr/local/lib/python3.3/dist-packages/django/core/management/__init__.py", line 272, in fetch_command
klass = load_command_class(app_name, subcommand)
File "/usr/local/lib/python3.3/dist-packages/django/core/management/__init__.py", line 75, in load_command_class
module = import_module('%s.management.commands.%s' % (app_name, name))
File "/usr/lib/python3.3/importlib/__init__.py", line 90, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 1584, in _gcd_import
File "<frozen importlib._bootstrap>", line 1565, in _find_and_load
File "<frozen importlib._bootstrap>", line 1512, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 313, in _call_with_frames_removed
File "<frozen importlib._bootstrap>", line 1584, in _gcd_import
File "<frozen importlib._bootstrap>", line 1565, in _find_and_load
File "<frozen importlib._bootstrap>", line 1532, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 584, in _check_name_wrapper
File "<frozen importlib._bootstrap>", line 1022, in load_module
File "<frozen importlib._bootstrap>", line 1003, in load_module
File "<frozen importlib._bootstrap>", line 560, in module_for_loader_wrapper
File "<frozen importlib._bootstrap>", line 868, in _load_module
File "<frozen importlib._bootstrap>", line 313, in _call_with_frames_removed
File "/usr/local/lib/python3.3/dist-packages/south/management/commands/__init__.py", line 13, in <module>
from south.management.commands.syncdb import Command as SyncCommand
File "/usr/local/lib/python3.3/dist-packages/south/management/commands/syncdb.py", line 19, in <module>
from south.db import dbs
File "/usr/local/lib/python3.3/dist-packages/south/db/__init__.py", line 83, in <module>
db = dbs[DEFAULT_DB_ALIAS]
KeyError: 'default'

Solved via the discussion here: https://groups.google.com/forum/#!topic/south-users/hrxwgimaYy8

Add this to your settings file:

SOUTH_DATABASE_ADAPTERS = {
    'default' : 'south.db.mysql'
}

Thanks for posting that! I'll see if there's a useful way we can add a reference to that in the docs.