3.1.txt 7.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316
  1. ============================================
  2. Django 3.1 release notes - UNDER DEVELOPMENT
  3. ============================================
  4. *Expected August 2020*
  5. Welcome to Django 3.1!
  6. These release notes cover the :ref:`new features <whats-new-3.1>`, as well as
  7. some :ref:`backwards incompatible changes <backwards-incompatible-3.1>` you'll
  8. want to be aware of when upgrading from Django 3.0 or earlier. We've
  9. :ref:`dropped some features<removed-features-3.1>` that have reached the end of
  10. their deprecation cycle, and we've :ref:`begun the deprecation process for
  11. some features <deprecated-features-3.1>`.
  12. See the :doc:`/howto/upgrade-version` guide if you're updating an existing
  13. project.
  14. Python compatibility
  15. ====================
  16. Django 3.1 supports Python 3.6, 3.7, and 3.8. We **highly recommend** and only
  17. officially support the latest release of each series.
  18. .. _whats-new-3.1:
  19. What's new in Django 3.1
  20. ========================
  21. Minor features
  22. --------------
  23. :mod:`django.contrib.admin`
  24. ~~~~~~~~~~~~~~~~~~~~~~~~~~~
  25. * ...
  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. 180,000 to 216,000.
  33. * Added the :setting:`PASSWORD_RESET_TIMEOUT` setting to define the minimum
  34. number of seconds a password reset link is valid for. This is encouraged
  35. instead of deprecated ``PASSWORD_RESET_TIMEOUT_DAYS``, which will be removed
  36. in Django 4.0.
  37. :mod:`django.contrib.contenttypes`
  38. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  39. * ...
  40. :mod:`django.contrib.gis`
  41. ~~~~~~~~~~~~~~~~~~~~~~~~~
  42. * :lookup:`relate` lookup is now supported on MariaDB.
  43. :mod:`django.contrib.messages`
  44. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  45. * ...
  46. :mod:`django.contrib.postgres`
  47. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  48. * ...
  49. :mod:`django.contrib.redirects`
  50. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  51. * ...
  52. :mod:`django.contrib.sessions`
  53. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  54. * ...
  55. :mod:`django.contrib.sitemaps`
  56. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  57. * ...
  58. :mod:`django.contrib.sites`
  59. ~~~~~~~~~~~~~~~~~~~~~~~~~~~
  60. * ...
  61. :mod:`django.contrib.staticfiles`
  62. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  63. * ...
  64. :mod:`django.contrib.syndication`
  65. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  66. * ...
  67. Cache
  68. ~~~~~
  69. * The :func:`~django.views.decorators.cache.cache_control` decorator and
  70. :func:`~django.utils.cache.patch_cache_control` method now support multiple
  71. field names in the ``no-cache`` directive for the ``Cache-Control`` header,
  72. according to :rfc:`7234#section-5.2.2.2`.
  73. CSRF
  74. ~~~~
  75. * ...
  76. Email
  77. ~~~~~
  78. * ...
  79. File Storage
  80. ~~~~~~~~~~~~
  81. * ...
  82. File Uploads
  83. ~~~~~~~~~~~~
  84. * ...
  85. Forms
  86. ~~~~~
  87. * ...
  88. Generic Views
  89. ~~~~~~~~~~~~~
  90. * ...
  91. Internationalization
  92. ~~~~~~~~~~~~~~~~~~~~
  93. * ...
  94. Logging
  95. ~~~~~~~
  96. * ...
  97. Management Commands
  98. ~~~~~~~~~~~~~~~~~~~
  99. * ...
  100. Migrations
  101. ~~~~~~~~~~
  102. * Migrations are now loaded also from directories without ``__init__.py``
  103. files.
  104. Models
  105. ~~~~~~
  106. * The new :class:`~django.db.models.functions.ExtractIsoWeekDay` function
  107. extracts ISO-8601 week days from :class:`~django.db.models.DateField` and
  108. :class:`~django.db.models.DateTimeField`, and the new :lookup:`iso_week_day`
  109. lookup allows querying by an ISO-8601 day of week.
  110. * :meth:`.QuerySet.explain` now supports:
  111. * ``TREE`` format on MySQL 8.0.16+,
  112. * ``analyze`` option on MySQL 8.0.18+ and MariaDB.
  113. Pagination
  114. ~~~~~~~~~~
  115. * :class:`~django.core.paginator.Paginator` can now be iterated over to yield
  116. its pages.
  117. Requests and Responses
  118. ~~~~~~~~~~~~~~~~~~~~~~
  119. * ...
  120. Serialization
  121. ~~~~~~~~~~~~~
  122. * ...
  123. Signals
  124. ~~~~~~~
  125. * ...
  126. Templates
  127. ~~~~~~~~~
  128. * ...
  129. Tests
  130. ~~~~~
  131. * :class:`~django.test.SimpleTestCase` now implements the ``debug()`` method to
  132. allow running a test without collecting the result and catching exceptions.
  133. This can be used to support running tests under a debugger.
  134. URLs
  135. ~~~~
  136. * ...
  137. Validators
  138. ~~~~~~~~~~
  139. * ...
  140. .. _backwards-incompatible-3.1:
  141. Backwards incompatible changes in 3.1
  142. =====================================
  143. Database backend API
  144. --------------------
  145. This section describes changes that may be needed in third-party database
  146. backends.
  147. * ``DatabaseOperations.fetch_returned_insert_columns()`` now requires an
  148. additional ``returning_params`` argument.
  149. Dropped support for MariaDB 10.1
  150. --------------------------------
  151. Upstream support for MariaDB 10.1 ends in October 2020. Django 3.1 supports
  152. MariaDB 10.2 and higher.
  153. Miscellaneous
  154. -------------
  155. * The cache keys used by :ttag:`cache` and generated by
  156. :func:`~django.core.cache.utils.make_template_fragment_key` are different
  157. from the keys generated by older versions of Django. After upgrading to
  158. Django 3.1, the first request to any previously cached template fragment will
  159. be a cache miss.
  160. * The compatibility imports of ``django.core.exceptions.EmptyResultSet`` in
  161. ``django.db.models.query``, ``django.db.models.sql``, and
  162. ``django.db.models.sql.datastructures`` are removed.
  163. * The compatibility import of ``django.core.exceptions.FieldDoesNotExist`` in
  164. ``django.db.models.fields`` is removed.
  165. * The compatibility imports of ``django.forms.utils.pretty_name()`` and
  166. ``django.forms.boundfield.BoundField`` in ``django.forms.forms`` are removed.
  167. * The compatibility imports of ``Context``, ``ContextPopException``, and
  168. ``RequestContext`` in ``django.template.base`` are removed.
  169. * The :setting:`STATIC_URL` and :setting:`MEDIA_URL` settings set to relative
  170. paths are now prefixed by the server-provided value of ``SCRIPT_NAME`` (or
  171. ``/`` if not set). This change should not affect settings set to valid URLs
  172. or absolute paths.
  173. * :class:`~django.middleware.http.ConditionalGetMiddleware` no longer adds the
  174. ``ETag`` header to responses with an empty
  175. :attr:`~django.http.HttpResponse.content`.
  176. * ``django.utils.decorators.classproperty()`` decorator is moved to
  177. ``django.utils.functional.classproperty()``.
  178. .. _deprecated-features-3.1:
  179. Features deprecated in 3.1
  180. ==========================
  181. Miscellaneous
  182. -------------
  183. * ``PASSWORD_RESET_TIMEOUT_DAYS`` setting is deprecated in favor of
  184. :setting:`PASSWORD_RESET_TIMEOUT`.
  185. * The undocumented usage of the :lookup:`isnull` lookup with non-boolean values
  186. as the right-hand side is deprecated, use ``True`` or ``False`` instead.
  187. .. _removed-features-3.1:
  188. Features removed in 3.1
  189. =======================
  190. These features have reached the end of their deprecation cycle and are removed
  191. in Django 3.1.
  192. See :ref:`deprecated-features-2.2` for details on these changes, including how
  193. to remove usage of these features.
  194. * ``django.utils.timezone.FixedOffset`` is removed.
  195. * ``django.core.paginator.QuerySetPaginator`` is removed.
  196. * A model's ``Meta.ordering`` doesn't affect ``GROUP BY`` queries.
  197. * ``django.contrib.postgres.fields.FloatRangeField`` and
  198. ``django.contrib.postgres.forms.FloatRangeField`` are removed.
  199. * The ``FILE_CHARSET`` setting is removed.
  200. * ``django.contrib.staticfiles.storage.CachedStaticFilesStorage`` is removed.
  201. * The ``RemoteUserBackend.configure_user()`` method requires ``request`` as the
  202. first positional argument.
  203. * Support for ``SimpleTestCase.allow_database_queries`` and
  204. ``TransactionTestCase.multi_db`` is removed.