Django 3.1

3.1 released 4 August 2020, latest 3.1.14.

Django 3.1 reached end of life on 7 December 2021.

What changed

Django 3.1 added initial asynchronous support for ASGI deployments: views may be declared with async def, and middleware can operate in synchronous or asynchronous mode. It introduced a database-agnostic JSONField, replacing the need to use the PostgreSQL-specific JSONField for portable model definitions. It also added support for functional indexes through Index.expressions, along with several smaller ORM, template, form, administration, and management-command improvements. The async support was deliberately partial: much of Django, including the ORM, remained synchronous, so async views must avoid making blocking database or other synchronous calls directly on the event-loop path.

What staying costs

Django 3.1 has reached end of life, so its maintainers no longer provide security fixes, bug fixes, or compatibility updates for this line. Remaining on it leaves the application dependent on an unmaintained framework even when vulnerabilities or defects are identified. The risk increases as supported Python versions, database drivers, application servers, and Django ecosystem packages move on: dependency constraints can prevent upgrades, and an eventual migration can become larger because multiple Django compatibility changes accumulate. Teams using its async features should also recognize that their implementation was built on an early async model and may require review when moving to a newer Django release.

What to do

Inventory the application’s Python version, Django extensions, database drivers, deployment server, and any custom middleware, model fields, or management commands. Choose a currently supported Django target that is compatible with the required Python runtime, then read the release notes and deprecation guidance for every intervening Django line. Upgrade through supported intermediate releases where practical, run the full test suite at each step, and treat warnings as migration work rather than noise. Review JSONField imports and migrations, functional indexes, custom database SQL, and async views or middleware in particular. For async request paths, identify synchronous ORM, cache, filesystem, network, and third-party calls, then keep them in synchronous views or adapt them using Django’s supported async-boundary tools. Test production-like ASGI and WSGI deployment paths, dependency resolution, migrations, and rollback procedures before deploying the upgraded application.

We can tell you what moving off Django 3.1 involves.

What it takes to move off Django 3.1 depends on what you built on it — the version you are on, how much depends on it, and how much of the work is mechanical. Leave your email with this version and we can tell you what that looks like for you.

Not sure yet? Get my plan