Code

Opened 7 years ago

Closed 6 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: master
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: UI/UX:

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 7 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 Changed 7 years ago by anonymous

  • Cc philippe@… added; philippe@… removed
  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset
  • Summary changed from manage.py syncdb will fail silently when `DATABASE_NAME' is empty to manage.py syncdb will fail silently when `DATABASE_NAME' is empty with sqlite3
  • Triage Stage changed from Unreviewed to Accepted
  • Version changed from 0.96 to SVN

AFAIK it's still in trunk.

Changed 7 years ago by floguy

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

comment:2 Changed 7 years ago by floguy

  • 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 Changed 6 years ago by dkellerman

  • Owner changed from nobody to dkellerman

comment:4 Changed 6 years ago by dkellerman

  • Owner dkellerman deleted

comment:5 Changed 6 years ago by dkellerman

  • Owner set to nobody

comment:6 Changed 6 years ago by mtredinnick

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

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

Add Comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
as The resolution will be set. Next status will be 'closed'
The resolution will be deleted. Next status will be 'new'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.