[Django] #32264: Run database checks by default in some scenarios

8 views
Skip to first unread message

Django

unread,
Dec 13, 2020, 12:24:38 PM12/13/20
to django-...@googlegroups.com
#32264: Run database checks by default in some scenarios
-------------------------------------------------+------------------------
Reporter: Adam (Chainz) Johnson | Owner: nobody
Type: Cleanup/optimization | Status: new
Component: Core (System checks) | Version: 3.1
Severity: Normal | Keywords:
Triage Stage: Unreviewed | Has patch: 0
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 0 |
-------------------------------------------------+------------------------
#31055 disabled database checks by default in order to make tests that
don't set up certain databases pass. This is great but it leads to a
couple problems:

* Even with `manage.py check --deploy` as we suggest in the deployment
checklist, the database configuration checks won't be run now.
* Users need to name all their database aliases on the command line if
running `manage.py check`. Even if `--database default` was added to a
deployment script early in the project, it's likely to be forgotten when
adding a new database connection.
* Database checks *are* run during `manage.py migrate`, but that output
can be long if several migrations are executed with a higher verbosity
level, so any non-error messages are likely to be missed.

I write this as I'm trying to figure out what to do with the [https
://django-mysql.readthedocs.io/en/latest/checks.html Django-MySQL database
checks] which show several warnings to users to improve their database
configuration. I now realize that they will mostly be disabled for users
on Django 3.1.

My suggestions would be:

* Enable `--database __all__` to allow specifying all the database aliases
on the command line.
* Make `--deploy` imply `--database __all__` . Since this is normally run
around the same time as `migrate`, it shouldn't be an issue to connect to
all databases at that point (and was the behaviour of Django <3.1 anyway).
* Make `runserver` run database checks for all connections. This will help
catch issues in development.

--
Ticket URL: <https://code.djangoproject.com/ticket/32264>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
Dec 13, 2020, 5:33:44 PM12/13/20
to django-...@googlegroups.com
#32264: Run database checks by default in some scenarios
-------------------------------------+-------------------------------------
Reporter: Adam (Chainz) | Owner: nobody
Johnson |
Type: | Status: new
Cleanup/optimization |
Component: Core (System | Version: 3.1
checks) |
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted

Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Simon Charette):

* stage: Unreviewed => Accepted


Comment:

> Enable --database __all__ to allow specifying all the database aliases
on the command line.

I wonder if we could make `--database` without a value alias to
`--database __all__` instead. Maybe it's not a good idea due as might
cause an issue similar to #31621?

> Make --deploy imply --database __all__ . Since this is normally run

around the same time as migrate, it shouldn't be an issue to connect to


all databases at that point (and was the behaviour of Django <3.1 anyway).

> Make runserver run database checks for all connections. This will help
catch issues in development.

Makes sense to me.

--
Ticket URL: <https://code.djangoproject.com/ticket/32264#comment:1>

Django

unread,
Jun 20, 2026, 11:22:33 AMJun 20
to django-...@googlegroups.com
#32264: Run database checks by default in some scenarios
-------------------------------------+-------------------------------------
Reporter: Adam Johnson | Owner: CharulL00
Type: | Status: assigned
Cleanup/optimization |
Component: Core (System | Version: 3.1
checks) |
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by CharulL00):

* owner: nobody => CharulL00
* status: new => assigned

--
Ticket URL: <https://code.djangoproject.com/ticket/32264#comment:2>
Reply all
Reply to author
Forward
0 new messages