5.2.txt 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312
  1. ============================================
  2. Django 5.2 release notes - UNDER DEVELOPMENT
  3. ============================================
  4. *Expected April 2025*
  5. Welcome to Django 5.2!
  6. These release notes cover the :ref:`new features <whats-new-5.2>`, as well as
  7. some :ref:`backwards incompatible changes <backwards-incompatible-5.2>` you
  8. should be aware of when upgrading from Django 5.1 or earlier. We've
  9. :ref:`begun the deprecation process for some features
  10. <deprecated-features-5.2>`.
  11. See the :doc:`/howto/upgrade-version` guide if you're updating an existing
  12. project.
  13. Django 5.2 is designated as a :term:`long-term support release
  14. <Long-term support release>`. It will receive security updates for at least
  15. three years after its release. Support for the previous LTS, Django 4.2, will
  16. end in April 2026.
  17. Python compatibility
  18. ====================
  19. Django 5.2 supports Python 3.10, 3.11, 3.12, and 3.13. We **highly recommend**
  20. and only officially support the latest release of each series.
  21. .. _whats-new-5.2:
  22. What's new in Django 5.2
  23. ========================
  24. Minor features
  25. --------------
  26. :mod:`django.contrib.admin`
  27. ~~~~~~~~~~~~~~~~~~~~~~~~~~~
  28. * The ``admin/base.html`` template now has a new block
  29. :ref:`extrabody <extrabody>` for adding custom code before the closing
  30. ``</body>`` tag.
  31. :mod:`django.contrib.admindocs`
  32. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  33. * ...
  34. :mod:`django.contrib.auth`
  35. ~~~~~~~~~~~~~~~~~~~~~~~~~~
  36. * The default iteration count for the PBKDF2 password hasher is increased from
  37. 870,000 to 1,000,000.
  38. :mod:`django.contrib.contenttypes`
  39. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  40. * ...
  41. :mod:`django.contrib.gis`
  42. ~~~~~~~~~~~~~~~~~~~~~~~~~
  43. * ...
  44. :mod:`django.contrib.messages`
  45. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  46. * ...
  47. :mod:`django.contrib.postgres`
  48. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  49. * ...
  50. :mod:`django.contrib.redirects`
  51. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  52. * ...
  53. :mod:`django.contrib.sessions`
  54. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  55. * ...
  56. :mod:`django.contrib.sitemaps`
  57. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  58. * ...
  59. :mod:`django.contrib.sites`
  60. ~~~~~~~~~~~~~~~~~~~~~~~~~~~
  61. * ...
  62. :mod:`django.contrib.staticfiles`
  63. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  64. * ...
  65. :mod:`django.contrib.syndication`
  66. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  67. * All :class:`~django.utils.feedgenerator.SyndicationFeed` classes now support
  68. a ``stylesheets`` attribute. If specified, an ``<? xml-stylesheet ?>``
  69. processing instruction will be added to the top of the document for each
  70. stylesheet in the given list. See :ref:`feed-stylesheets` for more details.
  71. Asynchronous views
  72. ~~~~~~~~~~~~~~~~~~
  73. * ...
  74. Cache
  75. ~~~~~
  76. * ...
  77. CSRF
  78. ~~~~
  79. * ...
  80. Database backends
  81. ~~~~~~~~~~~~~~~~~
  82. * ...
  83. Decorators
  84. ~~~~~~~~~~
  85. * ...
  86. Email
  87. ~~~~~
  88. * Tuple items of :class:`EmailMessage.attachments
  89. <django.core.mail.EmailMessage>` and
  90. :class:`EmailMultiAlternatives.attachments
  91. <django.core.mail.EmailMultiAlternatives>` are now named tuples, as opposed
  92. to regular tuples.
  93. * :attr:`EmailMultiAlternatives.alternatives
  94. <django.core.mail.EmailMultiAlternatives.alternatives>` is now a list of
  95. named tuples, as opposed to regular tuples.
  96. * The new :meth:`~django.core.mail.EmailMultiAlternatives.body_contains` method
  97. returns a boolean indicating whether a provided text is contained in the
  98. email ``body`` and in all attached MIME type ``text/*`` alternatives.
  99. Error Reporting
  100. ~~~~~~~~~~~~~~~
  101. * The attribute :attr:`.SafeExceptionReporterFilter.hidden_settings` now
  102. treats values as sensitive if their name includes ``AUTH``.
  103. File Storage
  104. ~~~~~~~~~~~~
  105. * ...
  106. File Uploads
  107. ~~~~~~~~~~~~
  108. * ...
  109. Forms
  110. ~~~~~
  111. * The new :class:`~django.forms.ColorInput` form widget is for entering a color
  112. in ``rrggbb`` hexadecimal format and renders as ``<input type="color" ...>``.
  113. Some browsers support a visual color picker interface for this input type.
  114. * The new :class:`~django.forms.SearchInput` form widget is for entering search
  115. queries and renders as ``<input type="search" ...>``.
  116. * The new :class:`~django.forms.TelInput` form widget is for entering telephone
  117. numbers and renders as ``<input type="tel" ...>``.
  118. Generic Views
  119. ~~~~~~~~~~~~~
  120. * ...
  121. Internationalization
  122. ~~~~~~~~~~~~~~~~~~~~
  123. * ...
  124. Logging
  125. ~~~~~~~
  126. * ...
  127. Management Commands
  128. ~~~~~~~~~~~~~~~~~~~
  129. * A new warning is printed to the console when running :djadmin:`runserver` that
  130. ``runserver`` is unsuitable for production. This warning can be hidden by
  131. setting the :envvar:`HIDE_PRODUCTION_WARNING` environment variable to
  132. ``"true"``.
  133. Migrations
  134. ~~~~~~~~~~
  135. * ...
  136. Models
  137. ~~~~~~
  138. * The ``SELECT`` clause generated when using
  139. :meth:`QuerySet.values()<django.db.models.query.QuerySet.values>` and
  140. :meth:`~django.db.models.query.QuerySet.values_list` now matches the
  141. specified order of the referenced expressions. Previously the order was based
  142. of a set of counterintuitive rules which made query combination through
  143. methods such as
  144. :meth:`QuerySet.union()<django.db.models.query.QuerySet.union>` unpredictable.
  145. * Added support for validation of model constraints which use a
  146. :class:`~django.db.models.GeneratedField`.
  147. * The new :attr:`.Expression.set_returning` attribute specifies that the
  148. expression contains a set-returning function, enforcing subquery evaluation.
  149. This is necessary for many Postgres set-returning functions.
  150. Requests and Responses
  151. ~~~~~~~~~~~~~~~~~~~~~~
  152. * ...
  153. Security
  154. ~~~~~~~~
  155. * ...
  156. Serialization
  157. ~~~~~~~~~~~~~
  158. * ...
  159. Signals
  160. ~~~~~~~
  161. * ...
  162. Templates
  163. ~~~~~~~~~
  164. * ...
  165. Tests
  166. ~~~~~
  167. * Stack frames from Django's custom assertions are now hidden. This makes test
  168. failures easier to read and enables :option:`test --pdb` to directly enter
  169. into the failing test method.
  170. URLs
  171. ~~~~
  172. * ...
  173. Utilities
  174. ~~~~~~~~~
  175. * ...
  176. Validators
  177. ~~~~~~~~~~
  178. * ...
  179. .. _backwards-incompatible-5.2:
  180. Backwards incompatible changes in 5.2
  181. =====================================
  182. Database backend API
  183. --------------------
  184. This section describes changes that may be needed in third-party database
  185. backends.
  186. * ...
  187. :mod:`django.contrib.gis`
  188. -------------------------
  189. * Support for PostGIS 3.0 is removed.
  190. Dropped support for PostgreSQL 13
  191. ---------------------------------
  192. Upstream support for PostgreSQL 13 ends in November 2025. Django 5.2 supports
  193. PostgreSQL 14 and higher.
  194. Miscellaneous
  195. -------------
  196. * :attr:`EmailMultiAlternatives.alternatives
  197. <django.core.mail.EmailMultiAlternatives.alternatives>` should only be added
  198. to using :meth:`~django.core.mail.EmailMultiAlternatives.attach_alternative`.
  199. .. _deprecated-features-5.2:
  200. Features deprecated in 5.2
  201. ==========================
  202. Miscellaneous
  203. -------------
  204. * The ``all`` argument for the ``django.contrib.staticfiles.finders.find()``
  205. function is deprecated in favor of the ``find_all`` argument.