#15336 closed (fixed)
Spurious DeprecationWarning when no database settings present
Reported by: | Ivan Sagalaev | Owned by: | Ivan Sagalaev |
---|---|---|---|
Component: | Core (Other) | Version: | 1.2 |
Severity: | Keywords: | ||
Cc: | Triage Stage: | Ready for checkin | |
Has patch: | yes | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
If a db-less project doesn't set up database settings management commands produce a spurious DeprecationWarning:
django/db/__init__.py:18: DeprecationWarning: settings.DATABASE_* is deprecated; use settings.DATABASES instead. DeprecationWarning
This breaks running cron scripts due to cron considering any output from a program as a reason to yell into your email about something possibly broken.
The warning is raised on a single condition of empty settings.DATABASES. This is easily fixed by also checking if a deprecated settings.DATABASE_ENGINE is set. A patch is following.
Attachments (2)
Change History (6)
by , 14 years ago
Attachment: | 15336.diff added |
---|
comment:1 by , 14 years ago
Has patch: | set |
---|
I'm not really sure how to write a test for this because tests require database settings. However the fix seems to be pretty trivial and may be we could leave out tests in this case.
comment:2 by , 14 years ago
Component: | Uncategorized → Core framework |
---|---|
Triage Stage: | Unreviewed → Ready for checkin |
This is inherently difficult to test, so I'm happy to accept this RFC based on inspection and manual testing.
by , 13 years ago
Attachment: | __init__.py added |
---|
Patch