4.0.txt 7.5 KB

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