Opened 17 years ago

Closed 16 years ago

#5552 closed (fixed)

manage.py syncdb will fail silently when `DATABASE_NAME' is empty with sqlite3

Reported by: nicolas.couture@… Owned by: nobody
Component: Database layer (models, ORM) Version: dev
Severity: Keywords: syncdb DATABASE_NAME
Cc: philippe@…, floguy@… Triage Stage: Accepted
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

When leaving 'DATABASE_NAME' empty in our default settings.py, running `python manage.py syncdb' will fail silently. Leaving the users with an impression of successful creation of databases.

example:

[self@web19 myproject]$ python manage.py syncdb
Creating table auth_message
Creating table auth_group
Creating table auth_user
Creating table auth_permission
Creating table django_content_type
Creating table django_session
Creating table django_site
Creating table polls_poll
Creating table polls_choice

Could someone confirm this behavior is also present in versions greater than 0.96?

Attachments (1)

requiredsqlitedatabasename.patch (703 bytes ) - added by floguy 17 years ago.
Patch to fix this problem. Raises ImproperlyConfigured if there is no DATABASE_NAME.

Download all attachments as: .zip

Change History (7)

comment:1 by anonymous, 17 years ago

Cc: philippe@… added; philippe@… removed
Summary: manage.py syncdb will fail silently when `DATABASE_NAME' is emptymanage.py syncdb will fail silently when `DATABASE_NAME' is empty with sqlite3
Triage Stage: UnreviewedAccepted
Version: 0.96SVN

AFAIK it's still in trunk.

by floguy, 17 years ago

Patch to fix this problem. Raises ImproperlyConfigured if there is no DATABASE_NAME.

comment:2 by floguy, 17 years ago

Cc: floguy@… added
Has patch: set

I've just added a patch to check for this and throw and ImproperlyConfigured error if there is no DATABASE_NAME. I can't think of a way to write a regression test for this, so I'll leave that to the experts!

comment:3 by dkellerman, 16 years ago

Owner: changed from nobody to dkellerman

comment:4 by dkellerman, 16 years ago

Owner: dkellerman removed

comment:5 by dkellerman, 16 years ago

Owner: set to nobody

comment:6 by Malcolm Tredinnick, 16 years ago

Resolution: fixed
Status: newclosed

(In [7956]) Fixed #5552 -- Raise an error, rather than failing silently, when DATABASE_NAME
is not specified for SQLite.

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