Opened 8 years ago

Closed 7 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 8 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 8 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 8 years ago by floguy

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

comment:2 Changed 8 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 7 years ago by dkellerman

  • Owner changed from nobody to dkellerman

comment:4 Changed 7 years ago by dkellerman

  • Owner dkellerman deleted

comment:5 Changed 7 years ago by dkellerman

  • Owner set to nobody

comment:6 Changed 7 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.

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