6.0.txt 9.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398
  1. ============================================
  2. Django 6.0 release notes - UNDER DEVELOPMENT
  3. ============================================
  4. *Expected December 2025*
  5. Welcome to Django 6.0!
  6. These release notes cover the :ref:`new features <whats-new-6.0>`, as well as
  7. some :ref:`backwards incompatible changes <backwards-incompatible-6.0>` you'll
  8. want to be aware of when upgrading from Django 5.2 or earlier. We've
  9. :ref:`begun the deprecation process for some features
  10. <deprecated-features-6.0>`.
  11. See the :doc:`/howto/upgrade-version` guide if you're updating an existing
  12. project.
  13. Python compatibility
  14. ====================
  15. Django 6.0 supports Python 3.12 and 3.13. We **highly recommend** and only
  16. officially support the latest release of each series.
  17. The Django 5.2.x series is the last to support Python 3.10 and 3.11.
  18. Third-party library support for older version of Django
  19. =======================================================
  20. Following the release of Django 6.0, we suggest that third-party app authors
  21. drop support for all versions of Django prior to 5.2. At that time, you should
  22. be able to run your package's tests using ``python -Wd`` so that deprecation
  23. warnings appear. After making the deprecation warning fixes, your app should be
  24. compatible with Django 6.0.
  25. .. _whats-new-6.0:
  26. What's new in Django 6.0
  27. ========================
  28. Minor features
  29. --------------
  30. :mod:`django.contrib.admin`
  31. ~~~~~~~~~~~~~~~~~~~~~~~~~~~
  32. * ...
  33. :mod:`django.contrib.admindocs`
  34. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  35. * The new :attr:`.AdminSite.password_change_form` attribute allows customizing
  36. the form used in the admin site password change view.
  37. :mod:`django.contrib.auth`
  38. ~~~~~~~~~~~~~~~~~~~~~~~~~~
  39. * The default iteration count for the PBKDF2 password hasher is increased from
  40. 1,000,000 to 1,200,000.
  41. :mod:`django.contrib.contenttypes`
  42. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  43. * ...
  44. :mod:`django.contrib.gis`
  45. ~~~~~~~~~~~~~~~~~~~~~~~~~
  46. * The new :attr:`.GEOSGeometry.hasm` property checks whether the geometry has
  47. the M dimension.
  48. * The new :class:`~django.contrib.gis.db.models.functions.Rotate` database
  49. function rotates a geometry by a specified angle around the origin or a
  50. specified point.
  51. :mod:`django.contrib.messages`
  52. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  53. * ...
  54. :mod:`django.contrib.postgres`
  55. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  56. * ...
  57. :mod:`django.contrib.redirects`
  58. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  59. * ...
  60. :mod:`django.contrib.sessions`
  61. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  62. * ...
  63. :mod:`django.contrib.sitemaps`
  64. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  65. * ...
  66. :mod:`django.contrib.sites`
  67. ~~~~~~~~~~~~~~~~~~~~~~~~~~~
  68. * ...
  69. :mod:`django.contrib.staticfiles`
  70. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  71. * ...
  72. :mod:`django.contrib.syndication`
  73. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  74. * ...
  75. Cache
  76. ~~~~~
  77. * ...
  78. CSRF
  79. ~~~~
  80. * ...
  81. Decorators
  82. ~~~~~~~~~~
  83. * ...
  84. Email
  85. ~~~~~
  86. * ...
  87. Error Reporting
  88. ~~~~~~~~~~~~~~~
  89. * ...
  90. File Storage
  91. ~~~~~~~~~~~~
  92. * ...
  93. File Uploads
  94. ~~~~~~~~~~~~
  95. * ...
  96. Forms
  97. ~~~~~
  98. * ...
  99. Generic Views
  100. ~~~~~~~~~~~~~
  101. * ...
  102. Internationalization
  103. ~~~~~~~~~~~~~~~~~~~~
  104. * ...
  105. Logging
  106. ~~~~~~~
  107. * ...
  108. Management Commands
  109. ~~~~~~~~~~~~~~~~~~~
  110. * ...
  111. Migrations
  112. ~~~~~~~~~~
  113. * Squashed migrations can now themselves be squashed before being transitioned
  114. to normal migrations.
  115. Models
  116. ~~~~~~
  117. * :doc:`Constraints </ref/models/constraints>` now implement a ``check()``
  118. method that is already registered with the check framework.
  119. * The new ``order_by`` argument for :class:`~django.db.models.Aggregate` allows
  120. specifying the ordering of the elements in the result.
  121. * The new :attr:`.Aggregate.allow_order_by` class attribute determines whether
  122. the aggregate function allows passing an ``order_by`` keyword argument.
  123. * The new :class:`~django.db.models.StringAgg` aggregate returns the input
  124. values concatenated into a string, separated by the ``delimiter`` string.
  125. This aggregate was previously supported only for PostgreSQL.
  126. * The :meth:`~django.db.models.Model.save` method now raises a specialized
  127. :exc:`Model.NotUpdated <django.db.models.Model.NotUpdated>` exception, when
  128. :ref:`a forced update <ref-models-force-insert>` results in no affected rows,
  129. instead of a generic :exc:`django.db.DatabaseError`.
  130. Pagination
  131. ~~~~~~~~~~
  132. * The new :class:`~django.core.paginator.AsyncPaginator` and
  133. :class:`~django.core.paginator.AsyncPage` provide async implementations of
  134. :class:`~django.core.paginator.Paginator` and
  135. :class:`~django.core.paginator.Page` respectively.
  136. Requests and Responses
  137. ~~~~~~~~~~~~~~~~~~~~~~
  138. * ...
  139. Security
  140. ~~~~~~~~
  141. * ...
  142. Serialization
  143. ~~~~~~~~~~~~~
  144. * ...
  145. Signals
  146. ~~~~~~~
  147. * ...
  148. Templates
  149. ~~~~~~~~~
  150. * The new variable ``forloop.length`` is now available within a :ttag:`for`
  151. loop.
  152. Tests
  153. ~~~~~
  154. * ...
  155. URLs
  156. ~~~~
  157. * ...
  158. Utilities
  159. ~~~~~~~~~
  160. * ...
  161. Validators
  162. ~~~~~~~~~~
  163. * ...
  164. .. _backwards-incompatible-6.0:
  165. Backwards incompatible changes in 6.0
  166. =====================================
  167. Database backend API
  168. --------------------
  169. This section describes changes that may be needed in third-party database
  170. backends.
  171. * ``BaseDatabaseCreation.create_test_db(serialize)`` is deprecated. Use
  172. ``serialize_db_to_string()`` instead.
  173. * :class:`~django.db.backends.base.schema.BaseDatabaseSchemaEditor` and
  174. PostgreSQL backends no longer use ``CASCADE`` when dropping a column.
  175. Dropped support for MariaDB 10.5
  176. --------------------------------
  177. Upstream support for MariaDB 10.5 ends in June 2025. Django 6.0 supports
  178. MariaDB 10.6 and higher.
  179. Dropped support for Python < 3.12
  180. ---------------------------------
  181. Because Python 3.12 is now the minimum supported version for Django, any
  182. optional dependencies must also meet that requirement. The following versions
  183. of each library are the first to add or confirm compatibility with Python 3.12:
  184. * ``aiosmtpd`` 1.4.5
  185. * ``argon2-cffi`` 23.1.0
  186. * ``bcrypt`` 4.1.1
  187. * ``geoip2`` 4.8.0
  188. * ``Pillow`` 10.1.0
  189. * ``mysqlclient`` 2.2.1
  190. * ``numpy`` 1.26.0
  191. * ``PyYAML`` 6.0.2
  192. * ``psycopg`` 3.1.12
  193. * ``psycopg2`` 2.9.9
  194. * ``redis-py`` 5.1.0
  195. * ``selenium`` 4.23.0
  196. * ``sqlparse`` 0.5.0
  197. * ``tblib`` 3.0.0
  198. Miscellaneous
  199. -------------
  200. * The :ref:`JSON <serialization-formats-json>` serializer now writes a newline
  201. at the end of the output, even without the ``indent`` option set.
  202. .. _deprecated-features-6.0:
  203. Features deprecated in 6.0
  204. ==========================
  205. Miscellaneous
  206. -------------
  207. * ``BaseDatabaseCreation.create_test_db(serialize)`` is deprecated. Use
  208. ``serialize_db_to_string()`` instead.
  209. * The PostgreSQL ``StringAgg`` class is deprecated in favor of the generally
  210. available :class:`~django.db.models.StringAgg` class.
  211. * The PostgreSQL ``OrderableAggMixin`` is deprecated in favor of the
  212. ``order_by`` attribute now available on the ``Aggregate`` class.
  213. Features removed in 6.0
  214. =======================
  215. These features have reached the end of their deprecation cycle and are removed
  216. in Django 6.0.
  217. See :ref:`deprecated-features-5.0` for details on these changes, including how
  218. to remove usage of these features.
  219. * Support for passing positional arguments to ``BaseConstraint`` is removed.
  220. * The ``DjangoDivFormRenderer`` and ``Jinja2DivFormRenderer`` transitional form
  221. renderers are removed.
  222. * ``BaseDatabaseOperations.field_cast_sql()`` is removed.
  223. * ``request`` is required in the signature of ``ModelAdmin.lookup_allowed()``
  224. subclasses.
  225. * Support for calling ``format_html()`` without passing args or kwargs is
  226. removed.
  227. * The default scheme for ``forms.URLField`` changed from ``"http"`` to
  228. ``"https"``.
  229. * The ``FORMS_URLFIELD_ASSUME_HTTPS`` transitional setting is removed.
  230. * The ``django.db.models.sql.datastructures.Join`` no longer fallback to
  231. ``get_joining_columns()``.
  232. * The ``get_joining_columns()`` method of ``ForeignObject`` and
  233. ``ForeignObjectRel`` is removed.
  234. * The ``ForeignObject.get_reverse_joining_columns()`` method is be removed.
  235. * Support for ``cx_Oracle`` is removed.
  236. * The ``ChoicesMeta`` alias to ``django.db.models.enums.ChoicesType`` is
  237. removed.
  238. * The ``Prefetch.get_current_queryset()`` method is removed.
  239. * The ``get_prefetch_queryset()`` method of related managers and descriptors is
  240. removed.
  241. * ``get_prefetcher()`` and ``prefetch_related_objects()`` no longer fallback to
  242. ``get_prefetch_queryset()``.
  243. See :ref:`deprecated-features-5.1` for details on these changes, including how
  244. to remove usage of these features.
  245. * ``django.urls.register_converter()`` no longer allows overriding existing
  246. converters.
  247. * The ``ModelAdmin.log_deletion()`` and ``LogEntryManager.log_action()``
  248. methods are removed.
  249. * The undocumented ``django.utils.itercompat.is_iterable()`` function and the
  250. ``django.utils.itercompat`` module is removed.
  251. * The ``django.contrib.gis.geoip2.GeoIP2.coords()`` method is removed.
  252. * The ``django.contrib.gis.geoip2.GeoIP2.open()`` method is removed.
  253. * Support for passing positional arguments to ``Model.save()`` and
  254. ``Model.asave()`` is removed.
  255. * The setter for ``django.contrib.gis.gdal.OGRGeometry.coord_dim`` is removed.
  256. * The ``check`` keyword argument of ``CheckConstraint`` is removed.
  257. * The ``get_cache_name()`` method of ``FieldCacheMixin`` is removed.
  258. * The ``OS_OPEN_FLAGS`` attribute of
  259. :class:`~django.core.files.storage.FileSystemStorage` is removed.