Opened 15 years ago

Closed 14 years ago

Last modified 13 years ago

#13610 closed (fixed)

Missing ENGINE setting in settings.py doesn't produce error

Reported by: Jani Tiainen Owned by: Gregor Müllegger
Component: Core (Other) Version: dev
Severity: Keywords: settings config
Cc: Triage Stage: Ready for checkin
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

Given following database config:

DATABASES = {
             'default' : {
#                         'ENGINE' : '',
                          'USER' : 'myuser',
                          'PASSWORD' : 'mypass',
                          'HOST' : '128.0.0.1',
                          'NAME' : 'mydb',
                          'PORT' : '5432',
                          },
}

Doesn't produce helpful information, only:

$ ./manage.py syncdb
Unknown command: 'syncdb'
Type 'manage.py help' for usage.

./manage.py help produces correct list of runnable commands.

Attachments (1)

13610.patch (1.6 KB ) - added by Gregor Müllegger 15 years ago.

Download all attachments as: .zip

Change History (6)

by Gregor Müllegger, 15 years ago

Attachment: 13610.patch added

comment:1 by Gregor Müllegger, 15 years ago

Has patch: set
Needs tests: set
Owner: changed from nobody to Gregor Müllegger
Status: newassigned
Version: 1.2SVN

I added a patch but it doesn't contain a test because I'm unsure how to test this issue.

The syncdb command calls the django.db.init module which raises an KeyError if no ENGINE is set. But this error is catched in django/core/management/init__.py:258 so I also changed this file and moved some code out of the except clause to make spotting issues in management commands easier.

comment:2 by Russell Keith-Magee, 14 years ago

milestone: 1.3
Needs tests: unset
Triage Stage: UnreviewedReady for checkin

This is one of those times when it is ok to skip having a test, and just eyeball it prior to checkin.

The patch as presented looks reasonable, so I'll mark it ready for checkin.

comment:3 by Russell Keith-Magee, 14 years ago

Resolution: fixed
Status: assignedclosed

(In [13489]) Fixed #13610 -- Improved error reporting when the ENGINE setting is ommitted from a database configuration. Thanks to Gregor Müllegger for the report and patch.

comment:4 by Russell Keith-Magee, 14 years ago

(In [13490]) [1.2.X] Fixed #13610 -- Improved error reporting when the ENGINE setting is ommitted from a database configuration. Thanks to Gregor Müllegger for the report and patch.

Backport of r13489 from trunk.

comment:5 by Jacob, 13 years ago

milestone: 1.3

Milestone 1.3 deleted

Note: See TracTickets for help on using tickets.
Back to Top