Django

Code

Ticket #5552 (closed: fixed)

Opened 1 year ago

Last modified 4 months ago

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

Reported by: nicolas.couture@gmail.com Assigned to: nobody
Milestone: Component: Database layer (models, ORM)
Version: SVN Keywords: syncdb DATABASE_NAME
Cc: philippe@n2nsoft.fr, floguy@gmail.com Triage Stage: Accepted
Has patch: 1 Needs documentation: 0
Needs tests: 0 Patch needs improvement: 0

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

requiredsqlitedatabasename.patch (0.7 kB) - added by floguy on 09/20/07 20:58:03.
Patch to fix this problem. Raises ImproperlyConfigured? if there is no DATABASE_NAME.

Change History

09/20/07 03:40:16 changed by anonymous

  • cc changed from philippe@main.n2nsoft.fr to philippe@n2nsoft.fr.
  • needs_better_patch changed.
  • needs_tests changed.
  • 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.
  • version changed from 0.96 to SVN.
  • needs_docs changed.
  • stage changed from Unreviewed to Accepted.

AFAIK it's still in trunk.

09/20/07 20:58:03 changed by floguy

  • attachment requiredsqlitedatabasename.patch added.

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

09/20/07 21:00:21 changed by floguy

  • cc changed from philippe@n2nsoft.fr to philippe@n2nsoft.fr, floguy@gmail.com.
  • has_patch set to 1.

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!

07/18/08 15:38:56 changed by dkellerman

  • owner changed from nobody to dkellerman.

07/18/08 17:07:03 changed by dkellerman

  • owner deleted.

07/18/08 17:07:46 changed by dkellerman

  • owner set to nobody.

07/18/08 17:36:31 changed by mtredinnick

  • status changed from new to closed.
  • resolution set to fixed.

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


Add/Change #5552 (manage.py syncdb will fail silently when `DATABASE_NAME' is empty with sqlite3)




Change Properties
Action