Opened 7 years ago

Closed 6 years ago

Last modified 5 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: master
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: UI/UX:

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 7 years ago.

Download all attachments as: .zip

Change History (6)

Changed 7 years ago by Gregor Müllegger

Attachment: 13610.patch added

comment:1 Changed 7 years ago by Gregor Müllegger

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 Changed 6 years ago by Russell Keith-Magee

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 Changed 6 years ago by Russell Keith-Magee

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 Changed 6 years ago by Russell Keith-Magee

(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 Changed 5 years ago by Jacob

milestone: 1.3

Milestone 1.3 deleted

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