Spurious DeprecationWarning when no database settings present
|Reported by:||Ivan Sagalaev||Owned by:||Ivan Sagalaev|
|Cc:||Triage Stage:||Ready for checkin|
|Has patch:||yes||Needs documentation:||no|
|Needs tests:||no||Patch needs improvement:||no|
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.
Change History (6)
comment:1 Changed 6 years ago by
|Patch needs improvement:||unset|
comment:2 Changed 6 years ago by
|Component:||Uncategorized → Core framework|
|Triage Stage:||Unreviewed → Ready for checkin|