What’s New in Django 4.0? Key Features and Installation Guide

Django 4.0 has been officially released, bringing built‑in Redis caching, enhanced form customization, new password hashing, default zoneinfo support, upgraded jQuery, PostgreSQL improvements, and a test runner shuffle option, with a simple pip installation command.

21CTO
21CTO
21CTO
What’s New in Django 4.0? Key Features and Installation Guide

The Python web framework Django has officially released version 4.0, focusing on database caching and form customization improvements.

It now includes a new Redis cache backend, allowing developers to use Redis as an in‑memory cache with built‑in support, requiring a local or remote Redis server and Python‑Redis bindings.

Django 4.0 also simplifies customization of Forms, Formsets, and ErrorList, and enables rendering them with the template engine.

The release can be installed via pip: pip install Django==4.0 According to the release notes, the main updates are:

New RedisCache backend provides built‑in support for Redis caching.

Forms, Formsets and ErrorList can now be rendered using the template engine, simplifying customization.

Introduces a new password hashing algorithm scrypt (requires more memory and OpenSSL 1.1+, not enabled by default).

The Python standard library’s zoneinfo module is now the default timezone implementation in Django.

Adds functional unique constraints.

jQuery upgraded from 3.5.1 to 3.6.0.

admindocs now displays cached attributes for models.

PostgreSQL backend now supports connections via service name and drops support for PostgreSQL 9.6.

Django test runner adds a --shuffle option to run tests in random order.

The previous version, Django 3.0, introduced asynchronous support for Python about a year ago.

Original Source

Signed-in readers can open the original source through BestHub's protected redirect.

Sign in to view source
Republication Notice

This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactadmin@besthub.devand we will review it promptly.

redisDjangoFormsRelease Notes
21CTO
Written by

21CTO

21CTO (21CTO.com) offers developers community, training, and services, making it your go‑to learning and service platform.

0 followers
Reader feedback

How this landed with the community

Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.