2021-01-05 18:07:46 +08:00
|
|
|
============================================
|
|
|
|
Django 4.0 release notes - UNDER DEVELOPMENT
|
|
|
|
============================================
|
|
|
|
|
|
|
|
*Expected December 2021*
|
|
|
|
|
|
|
|
Welcome to Django 4.0!
|
|
|
|
|
|
|
|
These release notes cover the :ref:`new features <whats-new-4.0>`, as well as
|
|
|
|
some :ref:`backwards incompatible changes <backwards-incompatible-4.0>` you'll
|
|
|
|
want to be aware of when upgrading from Django 3.2 or earlier. We've
|
|
|
|
:ref:`begun the deprecation process for some features
|
|
|
|
<deprecated-features-4.0>`.
|
|
|
|
|
|
|
|
See the :doc:`/howto/upgrade-version` guide if you're updating an existing
|
|
|
|
project.
|
|
|
|
|
|
|
|
Python compatibility
|
|
|
|
====================
|
|
|
|
|
|
|
|
Django 4.0 supports Python 3.8, 3.9, and 3.10. We **highly recommend** and only
|
|
|
|
officially support the latest release of each series.
|
|
|
|
|
|
|
|
.. _whats-new-4.0:
|
|
|
|
|
|
|
|
What's new in Django 4.0
|
|
|
|
========================
|
|
|
|
|
|
|
|
Minor features
|
|
|
|
--------------
|
|
|
|
|
|
|
|
:mod:`django.contrib.admin`
|
|
|
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
|
|
|
|
|
|
* ...
|
|
|
|
|
|
|
|
:mod:`django.contrib.admindocs`
|
|
|
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
|
|
|
|
|
|
* ...
|
|
|
|
|
|
|
|
:mod:`django.contrib.auth`
|
|
|
|
~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
|
|
|
|
|
|
* ...
|
|
|
|
|
|
|
|
:mod:`django.contrib.contenttypes`
|
|
|
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
|
|
|
|
|
|
* ...
|
|
|
|
|
|
|
|
:mod:`django.contrib.gis`
|
|
|
|
~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
|
|
|
|
|
|
* ...
|
|
|
|
|
|
|
|
:mod:`django.contrib.messages`
|
|
|
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
|
|
|
|
|
|
* ...
|
|
|
|
|
|
|
|
:mod:`django.contrib.postgres`
|
|
|
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
|
|
|
|
|
|
* ...
|
|
|
|
|
|
|
|
:mod:`django.contrib.redirects`
|
|
|
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
|
|
|
|
|
|
* ...
|
|
|
|
|
|
|
|
:mod:`django.contrib.sessions`
|
|
|
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
|
|
|
|
|
|
* ...
|
|
|
|
|
|
|
|
:mod:`django.contrib.sitemaps`
|
|
|
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
|
|
|
|
|
|
* ...
|
|
|
|
|
|
|
|
:mod:`django.contrib.sites`
|
|
|
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
|
|
|
|
|
|
* ...
|
|
|
|
|
|
|
|
:mod:`django.contrib.staticfiles`
|
|
|
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
|
|
|
|
|
|
* ...
|
|
|
|
|
|
|
|
:mod:`django.contrib.syndication`
|
|
|
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
|
|
|
|
|
|
* ...
|
|
|
|
|
|
|
|
Cache
|
|
|
|
~~~~~
|
|
|
|
|
|
|
|
* ...
|
|
|
|
|
|
|
|
CSRF
|
|
|
|
~~~~
|
|
|
|
|
|
|
|
* ...
|
|
|
|
|
|
|
|
Decorators
|
|
|
|
~~~~~~~~~~
|
|
|
|
|
|
|
|
* ...
|
|
|
|
|
|
|
|
Email
|
|
|
|
~~~~~
|
|
|
|
|
|
|
|
* ...
|
|
|
|
|
|
|
|
Error Reporting
|
|
|
|
~~~~~~~~~~~~~~~
|
|
|
|
|
|
|
|
* ...
|
|
|
|
|
|
|
|
File Storage
|
|
|
|
~~~~~~~~~~~~
|
|
|
|
|
|
|
|
* ...
|
|
|
|
|
|
|
|
File Uploads
|
|
|
|
~~~~~~~~~~~~
|
|
|
|
|
|
|
|
* ...
|
|
|
|
|
|
|
|
Forms
|
|
|
|
~~~~~
|
|
|
|
|
|
|
|
* ...
|
|
|
|
|
|
|
|
Generic Views
|
|
|
|
~~~~~~~~~~~~~
|
|
|
|
|
|
|
|
* ...
|
|
|
|
|
|
|
|
Internationalization
|
|
|
|
~~~~~~~~~~~~~~~~~~~~
|
|
|
|
|
|
|
|
* ...
|
|
|
|
|
|
|
|
Logging
|
|
|
|
~~~~~~~
|
|
|
|
|
|
|
|
* ...
|
|
|
|
|
|
|
|
Management Commands
|
|
|
|
~~~~~~~~~~~~~~~~~~~
|
|
|
|
|
|
|
|
* ...
|
|
|
|
|
|
|
|
Migrations
|
|
|
|
~~~~~~~~~~
|
|
|
|
|
|
|
|
* ...
|
|
|
|
|
|
|
|
Models
|
|
|
|
~~~~~~
|
|
|
|
|
|
|
|
* ...
|
|
|
|
|
|
|
|
Requests and Responses
|
|
|
|
~~~~~~~~~~~~~~~~~~~~~~
|
|
|
|
|
|
|
|
* ...
|
|
|
|
|
|
|
|
Security
|
|
|
|
~~~~~~~~
|
|
|
|
|
|
|
|
* ...
|
|
|
|
|
|
|
|
Serialization
|
|
|
|
~~~~~~~~~~~~~
|
|
|
|
|
|
|
|
* ...
|
|
|
|
|
|
|
|
Signals
|
|
|
|
~~~~~~~
|
|
|
|
|
|
|
|
* ...
|
|
|
|
|
|
|
|
Templates
|
|
|
|
~~~~~~~~~
|
|
|
|
|
|
|
|
* ...
|
|
|
|
|
|
|
|
Tests
|
|
|
|
~~~~~
|
|
|
|
|
|
|
|
* ...
|
|
|
|
|
|
|
|
URLs
|
|
|
|
~~~~
|
|
|
|
|
|
|
|
* ...
|
|
|
|
|
|
|
|
Utilities
|
|
|
|
~~~~~~~~~
|
|
|
|
|
|
|
|
* ...
|
|
|
|
|
|
|
|
Validators
|
|
|
|
~~~~~~~~~~
|
|
|
|
|
|
|
|
* ...
|
|
|
|
|
|
|
|
.. _backwards-incompatible-4.0:
|
|
|
|
|
|
|
|
Backwards incompatible changes in 4.0
|
|
|
|
=====================================
|
|
|
|
|
|
|
|
Database backend API
|
|
|
|
--------------------
|
|
|
|
|
|
|
|
This section describes changes that may be needed in third-party database
|
|
|
|
backends.
|
|
|
|
|
|
|
|
* ...
|
|
|
|
|
|
|
|
Miscellaneous
|
|
|
|
-------------
|
|
|
|
|
|
|
|
* ...
|
|
|
|
|
|
|
|
.. _deprecated-features-4.0:
|
|
|
|
|
|
|
|
Features deprecated in 4.0
|
|
|
|
==========================
|
|
|
|
|
|
|
|
Miscellaneous
|
|
|
|
-------------
|
|
|
|
|
|
|
|
* ...
|
|
|
|
|
|
|
|
Features removed in 4.0
|
|
|
|
=======================
|
|
|
|
|
|
|
|
These features have reached the end of their deprecation cycle and are removed
|
|
|
|
in Django 4.0.
|
|
|
|
|
|
|
|
See :ref:`deprecated-features-3.0` for details on these changes, including how
|
|
|
|
to remove usage of these features.
|
|
|
|
|
2021-01-05 19:18:04 +08:00
|
|
|
* ``django.utils.http.urlquote()``, ``urlquote_plus()``, ``urlunquote()``, and
|
|
|
|
``urlunquote_plus()`` are removed.
|
2021-01-05 18:07:46 +08:00
|
|
|
|
2021-01-05 19:27:52 +08:00
|
|
|
* ``django.utils.encoding.force_text()`` and ``smart_text()`` are removed.
|
|
|
|
|
2021-01-05 19:45:08 +08:00
|
|
|
* ``django.utils.translation.ugettext()``, ``ugettext_lazy()``,
|
|
|
|
``ugettext_noop()``, ``ungettext()``, and ``ungettext_lazy()`` are removed.
|
|
|
|
|
2021-01-06 20:16:24 +08:00
|
|
|
* ``django.views.i18n.set_language()`` doesn't set the user language in
|
|
|
|
``request.session`` (key ``_language``).
|
|
|
|
|
2021-01-07 14:55:06 +08:00
|
|
|
* ``alias=None`` is required in the signature of
|
|
|
|
``django.db.models.Expression.get_group_by_cols()`` subclasses.
|
|
|
|
|
2021-01-07 15:09:04 +08:00
|
|
|
* ``django.utils.text.unescape_entities()`` is removed.
|
|
|
|
|
2021-01-07 15:15:39 +08:00
|
|
|
* ``django.utils.http.is_safe_url()`` is removed.
|
|
|
|
|
2021-01-05 18:07:46 +08:00
|
|
|
See :ref:`deprecated-features-3.1` for details on these changes, including how
|
|
|
|
to remove usage of these features.
|
|
|
|
|
2021-01-07 20:10:37 +08:00
|
|
|
* The ``PASSWORD_RESET_TIMEOUT_DAYS`` setting is removed.
|
2021-01-08 03:50:36 +08:00
|
|
|
|
|
|
|
* The :lookup:`isnull` lookup no longer allows using non-boolean values as the
|
|
|
|
right-hand side.
|
2021-01-08 03:56:49 +08:00
|
|
|
|
|
|
|
* The ``django.db.models.query_utils.InvalidQuery`` exception class is removed.
|
2021-01-10 03:31:27 +08:00
|
|
|
|
|
|
|
* The ``django-admin.py`` entry point is removed.
|
2021-01-11 19:27:40 +08:00
|
|
|
|
|
|
|
* The ``HttpRequest.is_ajax()`` method is removed.
|
2021-01-11 19:49:16 +08:00
|
|
|
|
|
|
|
* Support for the pre-Django 3.1 encoding format of cookies values used by
|
|
|
|
``django.contrib.messages.storage.cookie.CookieStorage`` is removed.
|
2021-01-12 03:31:49 +08:00
|
|
|
|
|
|
|
* Support for the pre-Django 3.1 password reset tokens in the admin site (that
|
|
|
|
use the SHA-1 hashing algorithm) is removed.
|
2021-01-12 04:27:01 +08:00
|
|
|
|
|
|
|
* Support for the pre-Django 3.1 encoding format of sessions is removed.
|