Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Django tutorial says I haven't set DATABASE_ENGINE setting yet... but I have

Tags:

mysql

django

I'm working through the Django tutorial and receiving the following error when I run the initial python manage.py syncdb:

Traceback (most recent call last):
File "manage.py", line 11, in <module>
  execute_manager(settings)
File "/Library/Python/2.6/site-packages/django/core/management/__init__.py", line 362 in execute_manager
  utility.execute()
File "/Library/Python/2.6/site-packages/django/core/management/__init__.py", line 303, in execute
  self.fetch_command(subcommand).run_from_argv(self.argv)
File "/Library/Python/2.6/site-packages/django/core/management/base.py", line 195, in run_from_argv
  self.execute(*args, **options.__dict__)
File "/Library/Python/2.6/site-packages/django/core/management/base.py", line 222, in execute
  output = self.handle(*args, **options)
File "/Library/Python/2.6/site-packages/django/core/management/base.py", line 351, in handle
  return self.handle_noargs(**options)
File "/Library/Python/2.6/site-packages/django/core/management/commands/syncdb.py", line 49, in handle_noargs
  cursor = connection.cursor()
File "/Library/Python/2.6/site-packages/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.

My settings.py looks like:

DATABASES = {
  'default': {
    'ENGINE': 'django.db.backends.mysql', # Add 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'.
    'NAME': 'dj_tut',                      # Or path to database file if using sqlite3.
    'USER': '',                      # Not used with sqlite3.
    'PASSWORD': '',                  # 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.
  }
}

I'm guessing this is something simple, but why isn't it seeing the ENGINE setting?

like image 817
Joe Avatar asked Jun 01 '10 06:06

Joe


2 Answers

It looks like you are using an earlier version of Django. That way of setting database configuration is from Django 1.2, but the error you are getting is from 1.1. If you are using version 1.1, use this version of the tutorial.

like image 190
Daniel Roseman Avatar answered Sep 22 '22 14:09

Daniel Roseman


'ENGINE': 'mysql',
'NAME': 'dj_tut',

and you will want to set a user and password.

like image 30
Gabriel Avatar answered Sep 23 '22 14:09

Gabriel