As of Django version 6.1, the check management command runs database-related checks by default, and attempts to access all databases configured in the DATABASES setting.
This backwards-incompatible change is mentioned in the release notes. However, I think it should be more explicitly covered elsewhere in the docs, e.g. this section says
By default, these checks will not be run.
and this section says
Database checks are not run by default […] They are only run by the migrate command or if you specify configured database aliases using the --database option when calling the check command.
Unless I’m missing something, these statements are not true as of Django 6.1.
Hi @mportesdev!
As of Django version 6.1, the check management command runs database-related checks by default, and attempts to access all databases configured in the DATABASES setting.
The second part is right. The first part doesn’t match my recollection – Django 6.1 does not change whether checks tagged with Tags.database run. When they do run, in 6.1 they run with all databases.
Did you encounter something in practice that surprised you?
@jacobtylerwalls You are right, the database tag is not affected. It’s the models tag that manifests the difference.
On Django 6.0, the check --tag models command will pass regardless of whether the database (postgres in my case) is running.
On Django 6.1, it will throw an error if the database is down.
(As a side note, it might be useful to see which checks/tags are being run, but the check command doesn’t provide any additional output at higher verbosity.)
Exactly, this was the sense of “callers should be prepared for” in the release note, but that’s pretty opaque—I’m open to improved wording!