WebFaction
Community site: login faq

I was walking through the Django getting started tutorial, and I am getting an error running this code:

python2.6 manage.py syncdb

I created a database and updated the settings.py file, but I keep getting an error saying my database engine was not set (I have Xed out my name, user, and password; but it's correct in the file):

DATABASES = {
    'default': {
        'ENGINE': 'django.db.backends.postgresql_psycopg2', # Add 'postgresql_psycopg2', 'postgresql', 'mysql'
        'NAME': 'XXXXX',                      # Or path to database file if using sqlite3.
        'USER': 'XXXXX',                      # Not used with sqlite3.
        'PASSWORD': 'XXXXX',                  # Not used with sqlite3.
        'HOST': '',                      # Set to empty string for localhost. Not used with sqlite3.
        'PORT': '',                      # Set to empty string for default. Not used with sqlite3.
    }
}

This is the error that I am getting:

Traceback (most recent call last):
  File "manage.py", line 11, in <module>
    execute_manager(settings)
  File "/home/tdavis/webapps/food/lib/python2.6/django/core/management/__init__.py", line 438, in execute_manager
    utility.execute()
  File "/home/tdavis/webapps/food/lib/python2.6/django/core/management/__init__.py", line 379, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "/home/tdavis/webapps/food/lib/python2.6/django/core/management/base.py", line 191, in run_from_argv
    self.execute(*args, **options.__dict__)
  File "/home/tdavis/webapps/food/lib/python2.6/django/core/management/base.py", line 220, in execute
    output = self.handle(*args, **options)
  File "/home/tdavis/webapps/food/lib/python2.6/django/core/management/base.py", line 351, in handle
    return self.handle_noargs(**options)
  File "/home/tdavis/webapps/food/lib/python2.6/django/core/management/commands/syncdb.py", line 52, in handle_noargs
    cursor = connection.cursor()
  File "/home/tdavis/webapps/food/lib/python2.6/django/db/backends/dummy/base.py", line 15, in complain
    raise ImproperlyConfigured("You haven't set the database ENGINE setting yet.")
django.core.exceptions.ImproperlyConfigured: You haven't set the database ENGINE setting yet.

Any feedback would be much appreciated. Thanks.

asked 20 Jan '11, 14:03

tdavis
1125
accept rate: 0%

edited 20 Jan '11, 14:04


The settings.py file was not UNIX formatted. You must have used an editor in another OS to edit the file. I fixed it by running,

$ dos2unix settings.py
permanent link

answered 20 Jan '11, 17:40

johns
5.4k312
accept rate: 23%

That's really weird, I was using TextMate on a mac to edit that file. But you are right, it did end up working, thanks. Although I was not prompted to create a super user. Is there a default one?

permanent link

answered 21 Jan '11, 07:57

tdavis
1125
accept rate: 0%

No, there is no default superuser. If you started off with an empty database, you should be prompted for a superuser during "syncdb" (unless you ran it with --noinput option).

(21 Jan '11, 08:04) tie

I did start with an empty database. I just ran python2.6 manage.py syncdb.

(21 Jan '11, 08:06) tdavis

Did you enable the admin application at all? Did syncdb create any of the admin tables?

(21 Jan '11, 08:12) tie

I followed the steps in the getting started tutorial and thought I enabled the admin app.

INSTALLED_APPS = ( 'django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.sites', 'django.contrib.messages', 'django.contrib.admin', # Uncomment the next line to enable admin documentation: # 'django.contrib.admindocs', )

I don't see any admin tables in there though.

(21 Jan '11, 08:20) tdavis

Most likely there is something wrong with your Django configuration. I'd suggest opening up a support ticket about it.

(21 Jan '11, 09:03) tie
Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×909
×108
×84

question asked: 20 Jan '11, 14:03

question was seen: 5,466 times

last updated: 21 Jan '11, 09:03

WEBFACTION
REACH US
SUPPORT
AFFILIATE PROGRAM
LEGAL
© COPYRIGHT 2003-2019 SWARMA LIMITED - WEBFACTION IS A SERVICE OF SWARMA LIMITED
REGISTERED IN ENGLAND AND WALES 5729350 - VAT REGISTRATION NUMBER 877397162
5TH FLOOR, THE OLD VINYL FACTORY, HAYES, UB3 1HA, UNITED KINGDOM