Update to Django 3.2
Django 3.2 has been released, and we should update to it. Doing so, the following changes in Django seem relevant:
-
Automatic AppConfig discovery — we can drop the default_app_config
from all__init__.py
s -
DEFAULT_AUTO_FIELD
is recommended to beBigAutoField
, even though it is not the default yet. We should consider setting it explicitly (but need to check whether this will cause migrations in libraries if set…) -
Functional indexes are now supported — we need to check models thatare often queried using a database function (e.g. aggregates), and add functional indexes for those queries (but leave the index out if write performance is more critical than search performance!) -
makemigrations
can now be called without a database connection — that means we can add a check for missing migrations to the pipelines -
Index.include
andUniqueConstraint.include
are now supported for creating covering indexes — we should check whether we have queries that can be turned into index-only scans that way -
FilteredRelation
now supports nested relations (probably most important for Alsijil) -
QuerySet.alias
can be used instead ofQuerySet.annotate
for aliases that are only needed for filtering (probably most interesting for Alsijil) -
Transforms in expressions — not sure -
SECRET_KEY
is not needed anymore for running most management commands — we can therefore remove the secret key from at least the migration job container in K8s
Edited by Nik | Klampfradler