Opened 5 years ago

Closed 5 years ago

Last modified 4 years ago

#13610 closed (fixed)

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

Reported by: jtiai Owned by: gregmuellegger
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 gregmuellegger 5 years ago.

Download all attachments as: .zip

Change History (6)

Changed 5 years ago by gregmuellegger

comment:1 Changed 5 years ago by gregmuellegger

  • Has patch set
  • Needs documentation unset
  • Needs tests set
  • Owner changed from nobody to gregmuellegger
  • Patch needs improvement unset
  • Status changed from new to assigned
  • Version changed from 1.2 to SVN

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 5 years ago by russellm

  • milestone set to 1.3
  • Needs tests unset
  • Triage Stage changed from Unreviewed to Ready 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 5 years ago by russellm

  • Resolution set to fixed
  • Status changed from assigned to closed

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

(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 4 years ago by jacob

  • milestone 1.3 deleted

Milestone 1.3 deleted

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