4.0.txt 6.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346
  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. .. _whats-new-4.0:
  18. What's new in Django 4.0
  19. ========================
  20. Minor features
  21. --------------
  22. :mod:`django.contrib.admin`
  23. ~~~~~~~~~~~~~~~~~~~~~~~~~~~
  24. * The ``admin/base.html`` template now has a new block ``header`` which
  25. contains the admin site header.
  26. :mod:`django.contrib.admindocs`
  27. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  28. * ...
  29. :mod:`django.contrib.auth`
  30. ~~~~~~~~~~~~~~~~~~~~~~~~~~
  31. * The default iteration count for the PBKDF2 password hasher is increased from
  32. 260,000 to 320,000.
  33. :mod:`django.contrib.contenttypes`
  34. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  35. * ...
  36. :mod:`django.contrib.gis`
  37. ~~~~~~~~~~~~~~~~~~~~~~~~~
  38. * ...
  39. :mod:`django.contrib.messages`
  40. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  41. * ...
  42. :mod:`django.contrib.postgres`
  43. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  44. * The PostgreSQL backend now supports connecting by a service name. See
  45. :ref:`postgresql-connection-settings` for more details.
  46. :mod:`django.contrib.redirects`
  47. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  48. * ...
  49. :mod:`django.contrib.sessions`
  50. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  51. * ...
  52. :mod:`django.contrib.sitemaps`
  53. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  54. * ...
  55. :mod:`django.contrib.sites`
  56. ~~~~~~~~~~~~~~~~~~~~~~~~~~~
  57. * ...
  58. :mod:`django.contrib.staticfiles`
  59. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  60. * ...
  61. :mod:`django.contrib.syndication`
  62. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  63. * ...
  64. Cache
  65. ~~~~~
  66. * ...
  67. CSRF
  68. ~~~~
  69. * ...
  70. Decorators
  71. ~~~~~~~~~~
  72. * ...
  73. Email
  74. ~~~~~
  75. * ...
  76. Error Reporting
  77. ~~~~~~~~~~~~~~~
  78. * ...
  79. File Storage
  80. ~~~~~~~~~~~~
  81. * ...
  82. File Uploads
  83. ~~~~~~~~~~~~
  84. * ...
  85. Forms
  86. ~~~~~
  87. * :class:`~django.forms.ModelChoiceField` now includes the provided value in
  88. the ``params`` argument of a raised
  89. :exc:`~django.core.exceptions.ValidationError` for the ``invalid_choice``
  90. error message. This allows custom error messages to use the ``%(value)s``
  91. placeholder.
  92. Generic Views
  93. ~~~~~~~~~~~~~
  94. * ...
  95. Internationalization
  96. ~~~~~~~~~~~~~~~~~~~~
  97. * ...
  98. Logging
  99. ~~~~~~~
  100. * ...
  101. Management Commands
  102. ~~~~~~~~~~~~~~~~~~~
  103. * The :djadmin:`runserver` management command now supports the
  104. :option:`--skip-checks` option.
  105. Migrations
  106. ~~~~~~~~~~
  107. * ...
  108. Models
  109. ~~~~~~
  110. * ...
  111. Requests and Responses
  112. ~~~~~~~~~~~~~~~~~~~~~~
  113. * ...
  114. Security
  115. ~~~~~~~~
  116. * ...
  117. Serialization
  118. ~~~~~~~~~~~~~
  119. * ...
  120. Signals
  121. ~~~~~~~
  122. * ...
  123. Templates
  124. ~~~~~~~~~
  125. * ...
  126. Tests
  127. ~~~~~
  128. * ...
  129. URLs
  130. ~~~~
  131. * ...
  132. Utilities
  133. ~~~~~~~~~
  134. * ...
  135. Validators
  136. ~~~~~~~~~~
  137. * ...
  138. .. _backwards-incompatible-4.0:
  139. Backwards incompatible changes in 4.0
  140. =====================================
  141. Database backend API
  142. --------------------
  143. This section describes changes that may be needed in third-party database
  144. backends.
  145. * ...
  146. :mod:`django.contrib.gis`
  147. -------------------------
  148. * Support for PostGIS 2.3 is removed.
  149. Dropped support for PostgreSQL 9.6
  150. ----------------------------------
  151. Upstream support for PostgreSQL 9.6 ends in November 2021. Django 4.0 supports
  152. PostgreSQL 10 and higher.
  153. Miscellaneous
  154. -------------
  155. * ...
  156. .. _deprecated-features-4.0:
  157. Features deprecated in 4.0
  158. ==========================
  159. Miscellaneous
  160. -------------
  161. * ...
  162. Features removed in 4.0
  163. =======================
  164. These features have reached the end of their deprecation cycle and are removed
  165. in Django 4.0.
  166. See :ref:`deprecated-features-3.0` for details on these changes, including how
  167. to remove usage of these features.
  168. * ``django.utils.http.urlquote()``, ``urlquote_plus()``, ``urlunquote()``, and
  169. ``urlunquote_plus()`` are removed.
  170. * ``django.utils.encoding.force_text()`` and ``smart_text()`` are removed.
  171. * ``django.utils.translation.ugettext()``, ``ugettext_lazy()``,
  172. ``ugettext_noop()``, ``ungettext()``, and ``ungettext_lazy()`` are removed.
  173. * ``django.views.i18n.set_language()`` doesn't set the user language in
  174. ``request.session`` (key ``_language``).
  175. * ``alias=None`` is required in the signature of
  176. ``django.db.models.Expression.get_group_by_cols()`` subclasses.
  177. * ``django.utils.text.unescape_entities()`` is removed.
  178. * ``django.utils.http.is_safe_url()`` is removed.
  179. See :ref:`deprecated-features-3.1` for details on these changes, including how
  180. to remove usage of these features.
  181. * The ``PASSWORD_RESET_TIMEOUT_DAYS`` setting is removed.
  182. * The :lookup:`isnull` lookup no longer allows using non-boolean values as the
  183. right-hand side.
  184. * The ``django.db.models.query_utils.InvalidQuery`` exception class is removed.
  185. * The ``django-admin.py`` entry point is removed.
  186. * The ``HttpRequest.is_ajax()`` method is removed.
  187. * Support for the pre-Django 3.1 encoding format of cookies values used by
  188. ``django.contrib.messages.storage.cookie.CookieStorage`` is removed.
  189. * Support for the pre-Django 3.1 password reset tokens in the admin site (that
  190. use the SHA-1 hashing algorithm) is removed.
  191. * Support for the pre-Django 3.1 encoding format of sessions is removed.
  192. * Support for the pre-Django 3.1 ``django.core.signing.Signer`` signatures
  193. (encoded with the SHA-1 algorithm) is removed.
  194. * Support for the pre-Django 3.1 ``django.core.signing.dumps()`` signatures
  195. (encoded with the SHA-1 algorithm) in ``django.core.signing.loads()`` is
  196. removed.
  197. * Support for the pre-Django 3.1 user sessions (that use the SHA-1 algorithm)
  198. is removed.
  199. * The ``get_request`` argument for
  200. ``django.utils.deprecation.MiddlewareMixin.__init__()`` is required and
  201. doesn't accept ``None``.
  202. * The ``providing_args`` argument for ``django.dispatch.Signal`` is removed.
  203. * The ``length`` argument for ``django.utils.crypto.get_random_string()`` is
  204. required.
  205. * The ``list`` message for ``ModelMultipleChoiceField`` is removed.
  206. * Support for passing raw column aliases to ``QuerySet.order_by()`` is removed.
  207. * The ``NullBooleanField`` model field is removed, except for support in
  208. historical migrations.
  209. * ``django.conf.urls.url()`` is removed.
  210. * The ``django.contrib.postgres.fields.JSONField`` model field is removed,
  211. except for support in historical migrations.
  212. * ``django.contrib.postgres.fields.jsonb.KeyTransform`` and
  213. ``django.contrib.postgres.fields.jsonb.KeyTextTransform`` are removed.
  214. * ``django.contrib.postgres.forms.JSONField`` is removed.
  215. * The ``{% ifequal %}`` and ``{% ifnotequal %}`` template tags are removed.
  216. * The ``DEFAULT_HASHING_ALGORITHM`` transitional setting is removed.