4.0.txt 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669
  1. ============================================
  2. Django 4.0 release notes - UNDER DEVELOPMENT
  3. ============================================
  4. *Expected December 2021*
  5. Welcome to Django 4.0!
  6. These release notes cover the :ref:`new features <whats-new-4.0>`, as well as
  7. some :ref:`backwards incompatible changes <backwards-incompatible-4.0>` you'll
  8. want to be aware of when upgrading from Django 3.2 or earlier. We've
  9. :ref:`begun the deprecation process for some features
  10. <deprecated-features-4.0>`.
  11. See the :doc:`/howto/upgrade-version` guide if you're updating an existing
  12. project.
  13. Python compatibility
  14. ====================
  15. Django 4.0 supports Python 3.8, 3.9, and 3.10. We **highly recommend** and only
  16. officially support the latest release of each series.
  17. The Django 3.2.x series is the last to support Python 3.6 and 3.7.
  18. .. _whats-new-4.0:
  19. What's new in Django 4.0
  20. ========================
  21. Functional unique constraints
  22. -----------------------------
  23. The new :attr:`*expressions <django.db.models.UniqueConstraint.expressions>`
  24. positional argument of
  25. :class:`UniqueConstraint() <django.db.models.UniqueConstraint>` enables
  26. creating functional unique constraints on expressions and database functions.
  27. For example::
  28. from django.db import models
  29. from django.db.models import UniqueConstraint
  30. from django.db.models.functions import Lower
  31. class MyModel(models.Model):
  32. first_name = models.CharField(max_length=255)
  33. last_name = models.CharField(max_length=255)
  34. class Meta:
  35. indexes = [
  36. UniqueConstraint(
  37. Lower('first_name'),
  38. Lower('last_name').desc(),
  39. name='first_last_name_unique',
  40. ),
  41. ]
  42. Functional unique constraints are added to models using the
  43. :attr:`Meta.constraints <django.db.models.Options.constraints>` option.
  44. ``scrypt`` password hasher
  45. --------------------------
  46. The new :ref:`scrypt password hasher <scrypt-usage>` is more secure and
  47. recommended over PBKDF2. However, it's not the default as it requires OpenSSL
  48. 1.1+ and more memory.
  49. Minor features
  50. --------------
  51. :mod:`django.contrib.admin`
  52. ~~~~~~~~~~~~~~~~~~~~~~~~~~~
  53. * The ``admin/base.html`` template now has a new block ``header`` which
  54. contains the admin site header.
  55. * The new :meth:`.ModelAdmin.get_formset_kwargs` method allows customizing the
  56. keyword arguments passed to the constructor of a formset.
  57. * The navigation sidebar now has a quick filter toolbar.
  58. * The new context variable ``model`` which contains the model class for each
  59. model is added to the :meth:`.AdminSite.each_context` method.
  60. * The new :attr:`.ModelAdmin.search_help_text` attribute allows specifying a
  61. descriptive text for the search box.
  62. :mod:`django.contrib.admindocs`
  63. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  64. * The admindocs now allows esoteric setups where :setting:`ROOT_URLCONF` is not
  65. a string.
  66. * The model section of the ``admindocs`` now shows cached properties.
  67. :mod:`django.contrib.auth`
  68. ~~~~~~~~~~~~~~~~~~~~~~~~~~
  69. * The default iteration count for the PBKDF2 password hasher is increased from
  70. 260,000 to 320,000.
  71. * The new
  72. :attr:`LoginView.next_page <django.contrib.auth.views.LoginView.next_page>`
  73. attribute and
  74. :meth:`~django.contrib.auth.views.LoginView.get_default_redirect_url` method
  75. allow customizing the redirect after login.
  76. :mod:`django.contrib.contenttypes`
  77. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  78. * ...
  79. :mod:`django.contrib.gis`
  80. ~~~~~~~~~~~~~~~~~~~~~~~~~
  81. * Added support for SpatiaLite 5.
  82. * :class:`~django.contrib.gis.gdal.GDALRaster` now allows creating rasters in
  83. any GDAL virtual filesystem.
  84. :mod:`django.contrib.messages`
  85. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  86. * ...
  87. :mod:`django.contrib.postgres`
  88. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  89. * The PostgreSQL backend now supports connecting by a service name. See
  90. :ref:`postgresql-connection-settings` for more details.
  91. * The new :class:`~django.contrib.postgres.operations.AddConstraintNotValid`
  92. operation allows creating check constraints on PostgreSQL without verifying
  93. that all existing rows satisfy the new constraint.
  94. * The new :class:`~django.contrib.postgres.operations.ValidateConstraint`
  95. operation allows validating check constraints which were created using
  96. :class:`~django.contrib.postgres.operations.AddConstraintNotValid` on
  97. PostgreSQL.
  98. * The new
  99. :class:`ArraySubquery() <django.contrib.postgres.expressions.ArraySubquery>`
  100. expression allows using subqueries to construct lists of values on
  101. PostgreSQL.
  102. :mod:`django.contrib.redirects`
  103. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  104. * ...
  105. :mod:`django.contrib.sessions`
  106. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  107. * ...
  108. :mod:`django.contrib.sitemaps`
  109. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  110. * ...
  111. :mod:`django.contrib.sites`
  112. ~~~~~~~~~~~~~~~~~~~~~~~~~~~
  113. * ...
  114. :mod:`django.contrib.staticfiles`
  115. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  116. * :class:`~django.contrib.staticfiles.storage.ManifestStaticFilesStorage` now
  117. replaces paths to JavaScript source map references with their hashed
  118. counterparts.
  119. * :class:`~django.contrib.staticfiles.storage.ManifestStaticFilesStorage` now
  120. replaces paths to JavaScript modules in ``import`` and ``export`` statements
  121. with their hashed counterparts.
  122. :mod:`django.contrib.syndication`
  123. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  124. * ...
  125. Cache
  126. ~~~~~
  127. * ...
  128. CSRF
  129. ~~~~
  130. * CSRF protection now consults the ``Origin`` header, if present. To facilitate
  131. this, :ref:`some changes <csrf-trusted-origins-changes-4.0>` to the
  132. :setting:`CSRF_TRUSTED_ORIGINS` setting are required.
  133. Decorators
  134. ~~~~~~~~~~
  135. * ...
  136. Email
  137. ~~~~~
  138. * ...
  139. Error Reporting
  140. ~~~~~~~~~~~~~~~
  141. * ...
  142. File Storage
  143. ~~~~~~~~~~~~
  144. * ...
  145. File Uploads
  146. ~~~~~~~~~~~~
  147. * ...
  148. Forms
  149. ~~~~~
  150. * :class:`~django.forms.ModelChoiceField` now includes the provided value in
  151. the ``params`` argument of a raised
  152. :exc:`~django.core.exceptions.ValidationError` for the ``invalid_choice``
  153. error message. This allows custom error messages to use the ``%(value)s``
  154. placeholder.
  155. * :class:`~django.forms.formsets.BaseFormSet` now renders non-form errors with
  156. an additional class of ``nonform`` to help distinguish them from
  157. form-specific errors.
  158. * :class:`~django.forms.formsets.BaseFormSet` now allows customizing the widget
  159. used when deleting forms via
  160. :attr:`~django.forms.formsets.BaseFormSet.can_delete` by setting the
  161. :attr:`~django.forms.formsets.BaseFormSet.deletion_widget` attribute or
  162. overriding :meth:`~django.forms.formsets.BaseFormSet.get_deletion_widget`
  163. method.
  164. Generic Views
  165. ~~~~~~~~~~~~~
  166. * :class:`~django.views.generic.edit.DeleteView` now uses
  167. :class:`~django.views.generic.edit.FormMixin`, allowing you to provide a
  168. :class:`~django.forms.Form` subclass, with a checkbox for example, to confirm
  169. deletion. In addition, this allows ``DeleteView`` to function with
  170. :class:`django.contrib.messages.views.SuccessMessageMixin`.
  171. Internationalization
  172. ~~~~~~~~~~~~~~~~~~~~
  173. * ...
  174. Logging
  175. ~~~~~~~
  176. * The alias of the database used in an SQL call is now passed as extra context
  177. along with each message to the :ref:`django-db-logger` logger.
  178. Management Commands
  179. ~~~~~~~~~~~~~~~~~~~
  180. * The :djadmin:`runserver` management command now supports the
  181. :option:`--skip-checks` option.
  182. * On PostgreSQL, :djadmin:`dbshell` now supports specifying a password file.
  183. * The :djadmin:`shell` command now respects :py:data:`sys.__interactivehook__`
  184. at startup. This allows loading shell history between interactive sessions.
  185. As a consequence, ``readline`` is no longer loaded if running in *isolated*
  186. mode.
  187. Migrations
  188. ~~~~~~~~~~
  189. * ...
  190. Models
  191. ~~~~~~
  192. * New :meth:`QuerySet.contains(obj) <.QuerySet.contains>` method returns
  193. whether the queryset contains the given object. This tries to perform the
  194. query in the simplest and fastest way possible.
  195. * The new ``precision`` argument of the
  196. :class:`Round() <django.db.models.functions.Round>` database function allows
  197. specifying the number of decimal places after rounding.
  198. * :meth:`.QuerySet.bulk_create` now sets the primary key on objects when using
  199. SQLite 3.35+.
  200. * :class:`~django.db.models.DurationField` now supports multiplying and
  201. dividing by scalar values on SQLite.
  202. * :meth:`.QuerySet.bulk_update` now returns the number of objects updated.
  203. * The new :attr:`.Aggregate.empty_aggregate_value` attribute allows specifying
  204. a value to return when the aggregation is used over an empty result set.
  205. * The ``skip_locked`` argument of :meth:`.QuerySet.select_for_update()` is now
  206. allowed on MariaDB 10.6+.
  207. * :class:`~django.db.models.Lookup` expressions may now be used in ``QuerySet``
  208. annotations, aggregations, and directly in filters.
  209. * The new :ref:`default <aggregate-default>` argument for built-in aggregates
  210. allows specifying a value to be returned when the queryset (or grouping)
  211. contains no entries, rather than ``None``.
  212. Requests and Responses
  213. ~~~~~~~~~~~~~~~~~~~~~~
  214. * The :class:`~django.middleware.security.SecurityMiddleware` now adds the
  215. :ref:`Cross-Origin Opener Policy <cross-origin-opener-policy>` header with a
  216. value of ``'same-origin'`` to prevent cross-origin popups from sharing the
  217. same browsing context. You can prevent this header from being added by
  218. setting the :setting:`SECURE_CROSS_ORIGIN_OPENER_POLICY` setting to ``None``.
  219. Security
  220. ~~~~~~~~
  221. * ...
  222. Serialization
  223. ~~~~~~~~~~~~~
  224. * ...
  225. Signals
  226. ~~~~~~~
  227. * The new ``stdout`` argument for :func:`~django.db.models.signals.pre_migrate`
  228. and :func:`~django.db.models.signals.post_migrate` signals allows redirecting
  229. output to a stream-like object. It should be preferred over
  230. :py:data:`sys.stdout` and :py:func:`print` when emitting verbose output in
  231. order to allow proper capture when testing.
  232. Templates
  233. ~~~~~~~~~
  234. * ...
  235. Tests
  236. ~~~~~
  237. * The new ``serialized_aliases`` argument of
  238. :func:`django.test.utils.setup_databases` determines which
  239. :setting:`DATABASES` aliases test databases should have their state
  240. serialized to allow usage of the
  241. :ref:`serialized_rollback <test-case-serialized-rollback>` feature.
  242. * Django test runner now supports a :option:`--buffer <test --buffer>` option
  243. with parallel tests.
  244. * The new :meth:`.DiscoverRunner.log` method allows customizing the way
  245. messages are logged.
  246. * Django test runner now supports a :option:`--shuffle <test --shuffle>` option
  247. to execute tests in a random order.
  248. * The :option:`test --parallel` option now supports the value ``auto`` to run
  249. one test process for each processor core.
  250. URLs
  251. ~~~~
  252. * ...
  253. Utilities
  254. ~~~~~~~~~
  255. * ...
  256. Validators
  257. ~~~~~~~~~~
  258. * ...
  259. .. _backwards-incompatible-4.0:
  260. Backwards incompatible changes in 4.0
  261. =====================================
  262. Database backend API
  263. --------------------
  264. This section describes changes that may be needed in third-party database
  265. backends.
  266. * ``DatabaseOperations.year_lookup_bounds_for_date_field()`` and
  267. ``year_lookup_bounds_for_datetime_field()`` methods now take the optional
  268. ``iso_year`` argument in order to support bounds for ISO-8601 week-numbering
  269. years.
  270. * The second argument of ``DatabaseSchemaEditor._unique_sql()`` and
  271. ``_create_unique_sql()`` methods is now fields instead of columns.
  272. :mod:`django.contrib.gis`
  273. -------------------------
  274. * Support for PostGIS 2.3 is removed.
  275. * Support for GDAL 2.0 and GEOS 3.5 is removed.
  276. Dropped support for PostgreSQL 9.6
  277. ----------------------------------
  278. Upstream support for PostgreSQL 9.6 ends in November 2021. Django 4.0 supports
  279. PostgreSQL 10 and higher.
  280. Dropped support for Oracle 12.2 and 18c
  281. ---------------------------------------
  282. Upstream support for Oracle 12.2 ends in March 2022 and for Oracle 18c it ends
  283. in June 2021. Django 3.2 will be supported until April 2024. Django 4.0
  284. officially supports Oracle 19c.
  285. .. _csrf-trusted-origins-changes-4.0:
  286. ``CSRF_TRUSTED_ORIGINS`` changes
  287. --------------------------------
  288. Format change
  289. ~~~~~~~~~~~~~
  290. Values in the :setting:`CSRF_TRUSTED_ORIGINS` setting must include the scheme
  291. (e.g. ``'http://'`` or ``'https://'``) instead of only the hostname.
  292. Also, values that started with a dot, must now also include an asterisk before
  293. the dot. For example, change ``'.example.com'`` to ``'https://*.example.com'``.
  294. A system check detects any required changes.
  295. Configuring it may now be required
  296. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  297. As CSRF protection now consults the ``Origin`` header, you may need to set
  298. :setting:`CSRF_TRUSTED_ORIGINS`, particularly if you allow requests from
  299. subdomains by setting :setting:`CSRF_COOKIE_DOMAIN` (or
  300. :setting:`SESSION_COOKIE_DOMAIN` if :setting:`CSRF_USE_SESSIONS` is enabled) to
  301. a value starting with a dot.
  302. ``SecurityMiddleware`` no longer sets the ``X-XSS-Protection`` header
  303. ---------------------------------------------------------------------
  304. The :class:`~django.middleware.security.SecurityMiddleware` no longer sets the
  305. ``X-XSS-Protection`` header if the ``SECURE_BROWSER_XSS_FILTER`` setting is
  306. ``True``. The setting is removed.
  307. Most modern browsers don't honor the ``X-XSS-Protection`` HTTP header. You can
  308. use Content-Security-Policy_ without allowing ``'unsafe-inline'`` scripts
  309. instead.
  310. If you want to support legacy browsers and set the header, use this line in a
  311. custom middleware::
  312. response.headers.setdefault('X-XSS-Protection', '1; mode=block')
  313. .. _Content-Security-Policy: https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy
  314. Migrations autodetector changes
  315. -------------------------------
  316. The migrations autodetector now uses model states instead of model classes.
  317. Also, migration operations for ``ForeignKey`` and ``ManyToManyField`` fields no
  318. longer specify attributes which were not passed to the fields during
  319. initialization.
  320. As a side-effect, running ``makemigrations`` might generate no-op
  321. ``AlterField`` operations for ``ManyToManyField`` and ``ForeignKey`` fields in
  322. some cases.
  323. Miscellaneous
  324. -------------
  325. * Support for ``cx_Oracle`` < 7.0 is removed.
  326. * To allow serving a Django site on a subpath without changing the value of
  327. :setting:`STATIC_URL`, the leading slash is removed from that setting (now
  328. ``'static/'``) in the default :djadmin:`startproject` template.
  329. * The :class:`~django.contrib.admin.AdminSite` method for the admin ``index``
  330. view is no longer decorated with ``never_cache`` when accessed directly,
  331. rather than via the recommended ``AdminSite.urls`` property, or
  332. ``AdminSite.get_urls()`` method.
  333. * Unsupported operations on a sliced queryset now raise ``TypeError`` instead
  334. of ``AssertionError``.
  335. * The undocumented ``django.test.runner.reorder_suite()`` function is renamed
  336. to ``reorder_tests()``. It now accepts an iterable of tests rather than a
  337. test suite, and returns an iterator of tests.
  338. * Calling ``FileSystemStorage.delete()`` with an empty ``name`` now raises
  339. ``ValueError`` instead of ``AssertionError``.
  340. * Calling ``EmailMultiAlternatives.attach_alternative()`` or
  341. ``EmailMessage.attach()`` with an invalid ``content`` or ``mimetype``
  342. arguments now raise ``ValueError`` instead of ``AssertionError``.
  343. * :meth:`~django.test.SimpleTestCase.assertHTMLEqual` no longer considers a
  344. non-boolean attribute without a value equal to an attribute with the same
  345. name and value.
  346. * Tests that fail to load, for example due to syntax errors, now always match
  347. when using :option:`test --tag`.
  348. * The undocumented ``django.contrib.admin.utils.lookup_needs_distinct()``
  349. function is renamed to ``lookup_spawns_duplicates()``.
  350. * The undocumented ``HttpRequest.get_raw_uri()`` method is removed. The
  351. :meth:`.HttpRequest.build_absolute_uri` method may be a suitable alternative.
  352. * The ``object`` argument of undocumented ``ModelAdmin.log_addition()``,
  353. ``log_change()``, and ``log_deletion()`` methods is renamed to ``obj``.
  354. * :class:`~django.utils.feedgenerator.RssFeed`,
  355. :class:`~django.utils.feedgenerator.Atom1Feed`, and their subclasses now
  356. emit elements with no content as self-closing tags.
  357. * ``NodeList.render()`` no longer casts the output of ``render()`` method for
  358. individual nodes to a string. ``Node.render()`` should always return a string
  359. as documented.
  360. * The ``where_class`` property of ``django.db.models.sql.query.Query`` and the
  361. ``where_class`` argument to the private ``get_extra_restriction()`` method of
  362. ``ForeignObject`` and ``ForeignObjectRel`` are removed. If needed, initialize
  363. ``django.db.models.sql.where.WhereNode`` instead.
  364. * The ``filter_clause`` argument of the undocumented ``Query.add_filter()``
  365. method is replaced by two positional arguments ``filter_lhs`` and
  366. ``filter_rhs``.
  367. * :class:`~django.middleware.csrf.CsrfViewMiddleware` now uses
  368. ``request.META['CSRF_COOKIE_NEEDS_UPDATE']`` in place of
  369. ``request.META['CSRF_COOKIE_USED']``, ``request.csrf_cookie_needs_reset``,
  370. and ``response.csrf_cookie_set`` to track whether the CSRF cookie should be
  371. sent. This is an undocumented, private API.
  372. .. _deprecated-features-4.0:
  373. Features deprecated in 4.0
  374. ==========================
  375. Time zone support
  376. -----------------
  377. In order to follow good practice, the default value of the :setting:`USE_TZ`
  378. setting will change from ``False`` to ``True``, and time zone support will be
  379. enabled by default, in Django 5.0.
  380. Note that the default :file:`settings.py` file created by
  381. :djadmin:`django-admin startproject <startproject>` includes
  382. :setting:`USE_TZ = True <USE_TZ>` since Django 1.4.
  383. You can set ``USE_TZ`` to ``False`` in your project settings before then to
  384. opt-out.
  385. Miscellaneous
  386. -------------
  387. * ``SERIALIZE`` test setting is deprecated as it can be inferred from the
  388. :attr:`~django.test.TestCase.databases` with the
  389. :ref:`serialized_rollback <test-case-serialized-rollback>` option enabled.
  390. * The undocumented ``django.utils.baseconv`` module is deprecated.
  391. * The undocumented ``django.utils.datetime_safe`` module is deprecated.
  392. * The default sitemap protocol for sitemaps built outside the context of a
  393. request will change from ``'http'`` to ``'https'`` in Django 5.0.
  394. * The ``extra_tests`` argument for :meth:`.DiscoverRunner.build_suite` and
  395. :meth:`.DiscoverRunner.run_tests` is deprecated.
  396. * The :class:`~django.contrib.postgres.aggregates.ArrayAgg`,
  397. :class:`~django.contrib.postgres.aggregates.JSONBAgg`, and
  398. :class:`~django.contrib.postgres.aggregates.StringAgg` aggregates will return
  399. ``None`` when there are no rows instead of ``[]``, ``[]``, and ``''``
  400. respectively in Django 5.0. If you need the previous behavior, explicitly set
  401. ``default`` to ``Value([])``, ``Value('[]')``, or ``Value('')``.
  402. Features removed in 4.0
  403. =======================
  404. These features have reached the end of their deprecation cycle and are removed
  405. in Django 4.0.
  406. See :ref:`deprecated-features-3.0` for details on these changes, including how
  407. to remove usage of these features.
  408. * ``django.utils.http.urlquote()``, ``urlquote_plus()``, ``urlunquote()``, and
  409. ``urlunquote_plus()`` are removed.
  410. * ``django.utils.encoding.force_text()`` and ``smart_text()`` are removed.
  411. * ``django.utils.translation.ugettext()``, ``ugettext_lazy()``,
  412. ``ugettext_noop()``, ``ungettext()``, and ``ungettext_lazy()`` are removed.
  413. * ``django.views.i18n.set_language()`` doesn't set the user language in
  414. ``request.session`` (key ``_language``).
  415. * ``alias=None`` is required in the signature of
  416. ``django.db.models.Expression.get_group_by_cols()`` subclasses.
  417. * ``django.utils.text.unescape_entities()`` is removed.
  418. * ``django.utils.http.is_safe_url()`` is removed.
  419. See :ref:`deprecated-features-3.1` for details on these changes, including how
  420. to remove usage of these features.
  421. * The ``PASSWORD_RESET_TIMEOUT_DAYS`` setting is removed.
  422. * The :lookup:`isnull` lookup no longer allows using non-boolean values as the
  423. right-hand side.
  424. * The ``django.db.models.query_utils.InvalidQuery`` exception class is removed.
  425. * The ``django-admin.py`` entry point is removed.
  426. * The ``HttpRequest.is_ajax()`` method is removed.
  427. * Support for the pre-Django 3.1 encoding format of cookies values used by
  428. ``django.contrib.messages.storage.cookie.CookieStorage`` is removed.
  429. * Support for the pre-Django 3.1 password reset tokens in the admin site (that
  430. use the SHA-1 hashing algorithm) is removed.
  431. * Support for the pre-Django 3.1 encoding format of sessions is removed.
  432. * Support for the pre-Django 3.1 ``django.core.signing.Signer`` signatures
  433. (encoded with the SHA-1 algorithm) is removed.
  434. * Support for the pre-Django 3.1 ``django.core.signing.dumps()`` signatures
  435. (encoded with the SHA-1 algorithm) in ``django.core.signing.loads()`` is
  436. removed.
  437. * Support for the pre-Django 3.1 user sessions (that use the SHA-1 algorithm)
  438. is removed.
  439. * The ``get_response`` argument for
  440. ``django.utils.deprecation.MiddlewareMixin.__init__()`` is required and
  441. doesn't accept ``None``.
  442. * The ``providing_args`` argument for ``django.dispatch.Signal`` is removed.
  443. * The ``length`` argument for ``django.utils.crypto.get_random_string()`` is
  444. required.
  445. * The ``list`` message for ``ModelMultipleChoiceField`` is removed.
  446. * Support for passing raw column aliases to ``QuerySet.order_by()`` is removed.
  447. * The ``NullBooleanField`` model field is removed, except for support in
  448. historical migrations.
  449. * ``django.conf.urls.url()`` is removed.
  450. * The ``django.contrib.postgres.fields.JSONField`` model field is removed,
  451. except for support in historical migrations.
  452. * ``django.contrib.postgres.fields.jsonb.KeyTransform`` and
  453. ``django.contrib.postgres.fields.jsonb.KeyTextTransform`` are removed.
  454. * ``django.contrib.postgres.forms.JSONField`` is removed.
  455. * The ``{% ifequal %}`` and ``{% ifnotequal %}`` template tags are removed.
  456. * The ``DEFAULT_HASHING_ALGORITHM`` transitional setting is removed.