Installation Error in Ubuntu 12.04
  • I'm attempting the installation on a fairly new installation of Ubuntu 12.04. I've previously had it running perfectly on a Mint 12 system. 

    I'm following the instructions found here:

    All the steps seem to go off without a hitch right up until I get to the first call, and then I get the following screen dump:

    mike@Precise:/var/www/mybooktype$ syncdb --noinput
    Traceback (most recent call last):
      File "/usr/local/bin/", line 5, in <module>
        pkg_resources.run_script('Django==1.4', '')
      File "/usr/lib/python2.7/dist-packages/", line 499, in run_script
        self.require(requires)[0].run_script(script_name, ns)
      File "/usr/lib/python2.7/dist-packages/", line 1235, in run_script
        execfile(script_filename, namespace, namespace)
      File "/usr/local/lib/python2.7/dist-packages/Django-1.4-py2.7.egg/EGG-INFO/scripts/", line 5, in <module>
      File "/usr/local/lib/python2.7/dist-packages/Django-1.4-py2.7.egg/django/core/management/", line 443, in execute_from_command_line
      File "/usr/local/lib/python2.7/dist-packages/Django-1.4-py2.7.egg/django/core/management/", line 382, in execute
      File "/usr/local/lib/python2.7/dist-packages/Django-1.4-py2.7.egg/django/core/management/", line 261, in fetch_command
        klass = load_command_class(app_name, subcommand)
      File "/usr/local/lib/python2.7/dist-packages/Django-1.4-py2.7.egg/django/core/management/", line 69, in load_command_class
        module = import_module('' % (app_name, name))
      File "/usr/local/lib/python2.7/dist-packages/Django-1.4-py2.7.egg/django/utils/", line 35, in import_module
      File "/usr/local/lib/python2.7/dist-packages/South-0.7.5-py2.7.egg/south/management/commands/", line 13, in <module>
        from import Command as SyncCommand
      File "/usr/local/lib/python2.7/dist-packages/South-0.7.5-py2.7.egg/south/management/commands/", line 17, in <module>
        from south.db import dbs
      File "/usr/local/lib/python2.7/dist-packages/South-0.7.5-py2.7.egg/south/db/", line 78, in <module>
        db = dbs[DEFAULT_DB_ALIAS]
    KeyError: 'default'

    I've tried using postgresql, sqlite3, and mysql because it's the one I'm most familiar with. I don't seem to see any variation in the error depending on the type of DB that I'm using.

    I'm sure I'm doing something wrong that's easy and stupid here, and I just need someone to smack me upside the head and give me a clue. I'd really appreciate it.

    Thank you.
  • 4 Comments sorted by
  • Hi Mike,

    Booktype still works with older version of Django configuration and you are using latest version (Django 1.4). We plan to change it very very soon but until then you should manually change it in file.

    At the moment you have something like this:

    DATABASE_ENGINE = 'postgresql_psycopg2'

    DATABASE_NAME = 'mydatabase'

    DATABASE_USER = 'myuser'

    DATABASE_PASSWORD = 'something'

    DATABASE_HOST = 'localhost'


    You should change it into something like this:

    'default': {
    'NAME': 'mydatabase',

                                             'ENGINE': 'django.db.backends.postgresql_psycopg2',

                                             'USER': 'myuser',

                                             'PASSWORD': 'something'

  • Ah yes... they changed couple of things in Django 1.4. You will have to change template loaders as well. Now you have something (in file) like:


    and you will need to change it into something like:


  • Thank you very much! That helped a lot. I was able to get through all of the command line stuff with what looked like no errors! After everything loaded however, when I tried to access booktype, I got a new error. 

    ImproperlyConfigured at /

    Error importing template source loader django.template.loaders.filesystem.load_template_source: "'module' object has no attribute 'load_template_source'"
    Request Method:GET
    Request URL:
    Django Version:1.4
    Exception Type:ImproperlyConfigured
    Exception Value:
    Error importing template source loader django.template.loaders.filesystem.load_template_source: "'module' object has no attribute 'load_template_source'"
    Exception Location:/usr/local/lib/python2.7/dist-packages/Django-1.4-py2.7.egg/django/template/ in find_template_loader, line 101
    Python Executable:/usr/bin/python
    Python Version:2.7.3
    Python Path:
    Server time:Thu, 31 May 2012 17:26:01 +0200

  • Excellent!! That worked, but with one caveat. It still gave me the error whenever I tried to load the eggs template. I commented out that entire line, and it seems to be working fine. I haven't noticed any errors or anything. I logged in, created a book, edited a chapter (Mr. Ed's Adventures: A horse is a horse of course of course), and was able to save it. Is this going to come back to bite me later on not having that template?