3.1.txt 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629
  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. * The new ``django.contrib.admin.EmptyFieldListFilter`` for
  26. :attr:`.ModelAdmin.list_filter` allows filtering on empty values (empty
  27. strings and nulls) in the admin changelist view.
  28. * Filters in the right sidebar of the admin changelist view now contains a link
  29. to clear all filters.
  30. :mod:`django.contrib.admindocs`
  31. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  32. * ...
  33. :mod:`django.contrib.auth`
  34. ~~~~~~~~~~~~~~~~~~~~~~~~~~
  35. * The default iteration count for the PBKDF2 password hasher is increased from
  36. 180,000 to 216,000.
  37. * Added the :setting:`PASSWORD_RESET_TIMEOUT` setting to define the minimum
  38. number of seconds a password reset link is valid for. This is encouraged
  39. instead of deprecated ``PASSWORD_RESET_TIMEOUT_DAYS``, which will be removed
  40. in Django 4.0.
  41. * The password reset mechanism now uses the SHA-256 hashing algorithm. Support
  42. for tokens that use the old hashing algorithm remains until Django 4.0.
  43. :mod:`django.contrib.contenttypes`
  44. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  45. * ...
  46. :mod:`django.contrib.gis`
  47. ~~~~~~~~~~~~~~~~~~~~~~~~~
  48. * :lookup:`relate` lookup is now supported on MariaDB.
  49. * Added the :attr:`.LinearRing.is_counterclockwise` property.
  50. * :class:`~django.contrib.gis.db.models.functions.AsGeoJSON` is now supported
  51. on Oracle.
  52. * Added the :class:`~django.contrib.gis.db.models.functions.AsWKB` and
  53. :class:`~django.contrib.gis.db.models.functions.AsWKT` functions.
  54. :mod:`django.contrib.humanize`
  55. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  56. * :tfilter:`intword` template filter now supports negative integers.
  57. :mod:`django.contrib.messages`
  58. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  59. * ...
  60. :mod:`django.contrib.postgres`
  61. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  62. * The new :class:`~django.contrib.postgres.indexes.BloomIndex` class allows
  63. creating ``bloom`` indexes in the database. The new
  64. :class:`~django.contrib.postgres.operations.BloomExtension` migration
  65. operation installs the ``bloom`` extension to add support for this index.
  66. * :meth:`~django.db.models.Model.get_FOO_display` now supports
  67. :class:`~django.contrib.postgres.fields.ArrayField` and
  68. :class:`~django.contrib.postgres.fields.RangeField`.
  69. * The new :lookup:`rangefield.lower_inc`, :lookup:`rangefield.lower_inf`,
  70. :lookup:`rangefield.upper_inc`, and :lookup:`rangefield.upper_inf` allows
  71. querying :class:`~django.contrib.postgres.fields.RangeField` by a bound type.
  72. * :lookup:`rangefield.contained_by` now supports
  73. :class:`~django.db.models.SmallAutoField`,
  74. :class:`~django.db.models.AutoField`,
  75. :class:`~django.db.models.BigAutoField`,
  76. :class:`~django.db.models.SmallIntegerField`, and
  77. :class:`~django.db.models.DecimalField`.
  78. * :class:`~django.contrib.postgres.search.SearchQuery` now supports
  79. ``'websearch'`` search type on PostgreSQL 11+.
  80. * :class:`SearchQuery.value <django.contrib.postgres.search.SearchQuery>` now
  81. supports query expressions.
  82. * The new :class:`~django.contrib.postgres.search.SearchHeadline` class allows
  83. highlighting search results.
  84. * :lookup:`search` lookup now supports query expressions.
  85. :mod:`django.contrib.redirects`
  86. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  87. * ...
  88. :mod:`django.contrib.sessions`
  89. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  90. * The :setting:`SESSION_COOKIE_SAMESITE` setting now allows ``'None'`` (string)
  91. value to explicitly state that the cookie is sent with all same-site and
  92. cross-site requests.
  93. :mod:`django.contrib.sitemaps`
  94. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  95. * ...
  96. :mod:`django.contrib.sites`
  97. ~~~~~~~~~~~~~~~~~~~~~~~~~~~
  98. * ...
  99. :mod:`django.contrib.staticfiles`
  100. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  101. * The :setting:`STATICFILES_DIRS` setting now supports :class:`pathlib.Path`.
  102. :mod:`django.contrib.syndication`
  103. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  104. * ...
  105. Cache
  106. ~~~~~
  107. * The :func:`~django.views.decorators.cache.cache_control` decorator and
  108. :func:`~django.utils.cache.patch_cache_control` method now support multiple
  109. field names in the ``no-cache`` directive for the ``Cache-Control`` header,
  110. according to :rfc:`7234#section-5.2.2.2`.
  111. * :meth:`~django.core.caches.cache.delete` now returns ``True`` if the key was
  112. successfully deleted, ``False`` otherwise.
  113. CSRF
  114. ~~~~
  115. * The :setting:`CSRF_COOKIE_SAMESITE` setting now allows ``'None'`` (string)
  116. value to explicitly state that the cookie is sent with all same-site and
  117. cross-site requests.
  118. Email
  119. ~~~~~
  120. * The :setting:`EMAIL_FILE_PATH` setting, used by the :ref:`file email backend
  121. <topic-email-file-backend>`, now supports :class:`pathlib.Path`.
  122. Error Reporting
  123. ~~~~~~~~~~~~~~~
  124. * :class:`django.views.debug.SafeExceptionReporterFilter` now filters sensitive
  125. values from ``request.META`` in exception reports.
  126. * The new :attr:`.SafeExceptionReporterFilter.cleansed_substitute` and
  127. :attr:`.SafeExceptionReporterFilter.hidden_settings` attributes allow
  128. customization of sensitive settings and ``request.META`` filtering in
  129. exception reports.
  130. * The technical 404 debug view now respects
  131. :setting:`DEFAULT_EXCEPTION_REPORTER_FILTER` when applying settings
  132. filtering.
  133. * The new :setting:`DEFAULT_EXCEPTION_REPORTER` allows providing a
  134. :class:`django.views.debug.ExceptionReporter` subclass to customize exception
  135. report generation. See :ref:`custom-error-reports` for details.
  136. File Storage
  137. ~~~~~~~~~~~~
  138. * ``FileSystemStorage.save()`` method now supports :class:`pathlib.Path`.
  139. File Uploads
  140. ~~~~~~~~~~~~
  141. * ...
  142. Forms
  143. ~~~~~
  144. * :class:`~django.forms.ModelChoiceIterator`, used by
  145. :class:`~django.forms.ModelChoiceField` and
  146. :class:`~django.forms.ModelMultipleChoiceField`, now uses
  147. :class:`~django.forms.ModelChoiceIteratorValue` that can be used by widgets
  148. to access model instances. See :ref:`iterating-relationship-choices` for
  149. details.
  150. * :class:`django.forms.DateTimeField` now accepts dates in a subset of ISO 8601
  151. datetime formats, including optional timezone (e.g. ``2019-10-10T06:47``,
  152. ``2019-10-10T06:47:23+04:00``, or ``2019-10-10T06:47:23Z``). Additionally, it
  153. now uses ``DATE_INPUT_FORMATS`` in addition to ``DATETIME_INPUT_FORMATS``
  154. when converting a field input to a ``datetime`` value.
  155. Generic Views
  156. ~~~~~~~~~~~~~
  157. * ...
  158. Internationalization
  159. ~~~~~~~~~~~~~~~~~~~~
  160. * The :setting:`LANGUAGE_COOKIE_SAMESITE` setting now allows ``'None'``
  161. (string) value to explicitly state that the cookie is sent with all same-site
  162. and cross-site requests.
  163. * Added support and translations for the Algerian Arabic language.
  164. Logging
  165. ~~~~~~~
  166. * ...
  167. Management Commands
  168. ~~~~~~~~~~~~~~~~~~~
  169. * The new :option:`check --database` option allows specifying database aliases
  170. for running the ``database`` system checks. Previously these checks were
  171. enabled for all configured :setting:`DATABASES` by passing the ``database``
  172. tag to the command.
  173. Migrations
  174. ~~~~~~~~~~
  175. * Migrations are now loaded also from directories without ``__init__.py``
  176. files.
  177. Models
  178. ~~~~~~
  179. * The new :class:`~django.db.models.functions.ExtractIsoWeekDay` function
  180. extracts ISO-8601 week days from :class:`~django.db.models.DateField` and
  181. :class:`~django.db.models.DateTimeField`, and the new :lookup:`iso_week_day`
  182. lookup allows querying by an ISO-8601 day of week.
  183. * :meth:`.QuerySet.explain` now supports:
  184. * ``TREE`` format on MySQL 8.0.16+,
  185. * ``analyze`` option on MySQL 8.0.18+ and MariaDB.
  186. * Added :class:`~django.db.models.PositiveBigIntegerField` which acts much like
  187. a :class:`~django.db.models.PositiveIntegerField` except that it only allows
  188. values under a certain (database-dependent) limit. Values from ``0`` to
  189. ``9223372036854775807`` are safe in all databases supported by Django.
  190. * The new :class:`~django.db.models.RESTRICT` option for
  191. :attr:`~django.db.models.ForeignKey.on_delete` argument of ``ForeignKey`` and
  192. ``OneToOneField`` emulates the behavior of the SQL constraint ``ON DELETE
  193. RESTRICT``.
  194. * :attr:`.CheckConstraint.check` now supports boolean expressions.
  195. * The :meth:`.RelatedManager.add`, :meth:`~.RelatedManager.create`, and
  196. :meth:`~.RelatedManager.set` methods now accept callables as values in the
  197. ``through_defaults`` argument.
  198. Pagination
  199. ~~~~~~~~~~
  200. * :class:`~django.core.paginator.Paginator` can now be iterated over to yield
  201. its pages.
  202. Requests and Responses
  203. ~~~~~~~~~~~~~~~~~~~~~~
  204. * If :setting:`ALLOWED_HOSTS` is empty and ``DEBUG=True``, subdomains of
  205. localhost are now allowed in the ``Host`` header, e.g. ``static.localhost``.
  206. * :meth:`.HttpResponse.set_cookie` and :meth:`.HttpResponse.set_signed_cookie`
  207. now allow using ``samesite='None'`` (string) to explicitly state that the
  208. cookie is sent with all same-site and cross-site requests.
  209. * The new :meth:`.HttpRequest.accepts` method returns whether the request
  210. accepts the given MIME type according to the ``Accept`` HTTP header.
  211. .. _whats-new-security-3.1:
  212. Security
  213. ~~~~~~~~
  214. * The :setting:`SECURE_REFERRER_POLICY` setting now defaults to
  215. ``'same-origin'``. With this configured,
  216. :class:`~django.middleware.security.SecurityMiddleware` sets the
  217. :ref:`referrer-policy` header to ``same-origin`` on all responses that do not
  218. already have it. This prevents the ``Referer`` header being sent to other
  219. origins. If you need the previous behavior, explicitly set
  220. :setting:`SECURE_REFERRER_POLICY` to ``None``.
  221. Serialization
  222. ~~~~~~~~~~~~~
  223. * ...
  224. Signals
  225. ~~~~~~~
  226. * ...
  227. Templates
  228. ~~~~~~~~~
  229. * The renamed :ttag:`translate` and :ttag:`blocktranslate` template tags are
  230. introduced for internationalization in template code. The older :ttag:`trans`
  231. and :ttag:`blocktrans` template tags aliases continue to work, and will be
  232. retained for the foreseeable future.
  233. * The :ttag:`include` template tag now accepts iterables of template names.
  234. Tests
  235. ~~~~~
  236. * :class:`~django.test.SimpleTestCase` now implements the ``debug()`` method to
  237. allow running a test without collecting the result and catching exceptions.
  238. This can be used to support running tests under a debugger.
  239. * The new :setting:`MIGRATE <TEST_MIGRATE>` test database setting allows
  240. disabling of migrations during a test database creation.
  241. * Django test runner now supports a :option:`test --buffer` option to discard
  242. output for passing tests.
  243. * :class:`~django.test.runner.DiscoverRunner` now skips running the system
  244. checks on databases not :ref:`referenced by tests<testing-multi-db>`.
  245. URLs
  246. ~~~~
  247. * :ref:`Path converters <registering-custom-path-converters>` can now raise
  248. ``ValueError`` in ``to_url()`` to indicate no match when reversing URLs.
  249. Utilities
  250. ~~~~~~~~~
  251. * :func:`~django.utils.encoding.filepath_to_uri` now supports
  252. :class:`pathlib.Path`.
  253. * :func:`~django.utils.dateparse.parse_duration` now supports comma separators
  254. for decimal fractions in the ISO 8601 format.
  255. * :func:`~django.utils.dateparse.parse_datetime`,
  256. :func:`~django.utils.dateparse.parse_duration`, and
  257. :func:`~django.utils.dateparse.parse_time` now support comma separators for
  258. milliseconds.
  259. Validators
  260. ~~~~~~~~~~
  261. * ...
  262. Miscellaneous
  263. ~~~~~~~~~~~~~
  264. * The SQLite backend now supports :class:`pathlib.Path` for the ``NAME``
  265. setting.
  266. * The ``settings.py`` generated by the :djadmin:`startproject` command now uses
  267. :class:`pathlib.Path` instead of :mod:`os.path` for building filesystem
  268. paths.
  269. * The :setting:`TIME_ZONE <DATABASE-TIME_ZONE>` setting is now allowed on
  270. databases that support time zones.
  271. .. _backwards-incompatible-3.1:
  272. Backwards incompatible changes in 3.1
  273. =====================================
  274. Database backend API
  275. --------------------
  276. This section describes changes that may be needed in third-party database
  277. backends.
  278. * ``DatabaseOperations.fetch_returned_insert_columns()`` now requires an
  279. additional ``returning_params`` argument.
  280. * ``connection.timezone`` property is now ``'UTC'`` by default, or the
  281. :setting:`TIME_ZONE <DATABASE-TIME_ZONE>` when :setting:`USE_TZ` is ``True``
  282. on databases that support time zones. Previously, it was ``None`` on
  283. databases that support time zones.
  284. * ``connection._nodb_connection`` property is changed to the
  285. ``connection._nodb_cursor()`` method and now returns a context manager that
  286. yields a cursor and automatically closes the cursor and connection upon
  287. exiting the ``with`` statement.
  288. Dropped support for MariaDB 10.1
  289. --------------------------------
  290. Upstream support for MariaDB 10.1 ends in October 2020. Django 3.1 supports
  291. MariaDB 10.2 and higher.
  292. ``contrib.admin`` browser support
  293. ---------------------------------
  294. The admin no longer supports the legacy Internet Explorer browser. See
  295. :ref:`the admin FAQ <admin-browser-support>` for details on supported browsers.
  296. :attr:`AbstractUser.first_name <django.contrib.auth.models.User.first_name>` ``max_length`` increased to 150
  297. ------------------------------------------------------------------------------------------------------------
  298. A migration for :attr:`django.contrib.auth.models.User.first_name` is included.
  299. If you have a custom user model inheriting from ``AbstractUser``, you'll need
  300. to generate and apply a database migration for your user model.
  301. If you want to preserve the 30 character limit for first names, use a custom
  302. form::
  303. from django import forms
  304. from django.contrib.auth.forms import UserChangeForm
  305. class MyUserChangeForm(UserChangeForm):
  306. first_name = forms.CharField(max_length=30, required=False)
  307. If you wish to keep this restriction in the admin when editing users, set
  308. ``UserAdmin.form`` to use this form::
  309. from django.contrib.auth.admin import UserAdmin
  310. from django.contrib.auth.models import User
  311. class MyUserAdmin(UserAdmin):
  312. form = MyUserChangeForm
  313. admin.site.unregister(User)
  314. admin.site.register(User, MyUserAdmin)
  315. Miscellaneous
  316. -------------
  317. * The cache keys used by :ttag:`cache` and generated by
  318. :func:`~django.core.cache.utils.make_template_fragment_key` are different
  319. from the keys generated by older versions of Django. After upgrading to
  320. Django 3.1, the first request to any previously cached template fragment will
  321. be a cache miss.
  322. * The logic behind the decision to return a redirection fallback or a 204 HTTP
  323. response from the :func:`~django.views.i18n.set_language` view is now based
  324. on the ``Accept`` HTTP header instead of the ``X-Requested-With`` HTTP header
  325. presence.
  326. * The compatibility imports of ``django.core.exceptions.EmptyResultSet`` in
  327. ``django.db.models.query``, ``django.db.models.sql``, and
  328. ``django.db.models.sql.datastructures`` are removed.
  329. * The compatibility import of ``django.core.exceptions.FieldDoesNotExist`` in
  330. ``django.db.models.fields`` is removed.
  331. * The compatibility imports of ``django.forms.utils.pretty_name()`` and
  332. ``django.forms.boundfield.BoundField`` in ``django.forms.forms`` are removed.
  333. * The compatibility imports of ``Context``, ``ContextPopException``, and
  334. ``RequestContext`` in ``django.template.base`` are removed.
  335. * The compatibility import of
  336. ``django.contrib.admin.helpers.ACTION_CHECKBOX_NAME`` in
  337. ``django.contrib.admin`` is removed.
  338. * The :setting:`STATIC_URL` and :setting:`MEDIA_URL` settings set to relative
  339. paths are now prefixed by the server-provided value of ``SCRIPT_NAME`` (or
  340. ``/`` if not set). This change should not affect settings set to valid URLs
  341. or absolute paths.
  342. * :class:`~django.middleware.http.ConditionalGetMiddleware` no longer adds the
  343. ``ETag`` header to responses with an empty
  344. :attr:`~django.http.HttpResponse.content`.
  345. * ``django.utils.decorators.classproperty()`` decorator is moved to
  346. ``django.utils.functional.classproperty()``.
  347. * :tfilter:`floatformat` template filter now outputs (positive) ``0`` for
  348. negative numbers which round to zero.
  349. * :attr:`Meta.ordering <django.db.models.Options.ordering>` and
  350. :attr:`Meta.unique_together <django.db.models.Options.unique_together>`
  351. options on models in ``django.contrib`` modules that were formerly tuples are
  352. now lists.
  353. * The admin calendar widget now handles two-digit years according to the Open
  354. Group Specification, i.e. values between 69 and 99 are mapped to the previous
  355. century, and values between 0 and 68 are mapped to the current century.
  356. * Date-only formats are removed from the default list for
  357. :setting:`DATETIME_INPUT_FORMATS`.
  358. * The :class:`~django.forms.FileInput` widget no longer renders with the
  359. ``required`` HTML attribute when initial data exists.
  360. * The undocumented ``django.views.debug.ExceptionReporterFilter`` class is
  361. removed. As per the :ref:`custom-error-reports` documentation, classes to be
  362. used with :setting:`DEFAULT_EXCEPTION_REPORTER_FILTER` needs to inherit from
  363. :class:`django.views.debug.SafeExceptionReporterFilter`.
  364. * The cache timeout set by :func:`~django.views.decorators.cache.cache_page`
  365. decorator now takes precedence over the ``max-age`` directive from the
  366. ``Cache-Control`` header.
  367. * Providing a non-local remote field in the :attr:`.ForeignKey.to_field`
  368. argument now raises :class:`~django.core.exceptions.FieldError`.
  369. * :setting:`SECURE_REFERRER_POLICY` now defaults to ``'same-origin'``. See the
  370. *What's New* :ref:`Security section <whats-new-security-3.1>` above for more
  371. details.
  372. * :djadmin:`check` management command now runs the ``database`` system checks
  373. only for database aliases specified using :option:`check --database` option.
  374. * :djadmin:`migrate` management command now runs the ``database`` system checks
  375. only for a database to migrate.
  376. * The admin CSS classes ``row1`` and ``row2`` are removed in favor of
  377. ``:nth-child(odd)`` and ``:nth-child(even)`` pseudo-classes.
  378. .. _deprecated-features-3.1:
  379. Features deprecated in 3.1
  380. ==========================
  381. Miscellaneous
  382. -------------
  383. * ``PASSWORD_RESET_TIMEOUT_DAYS`` setting is deprecated in favor of
  384. :setting:`PASSWORD_RESET_TIMEOUT`.
  385. * The undocumented usage of the :lookup:`isnull` lookup with non-boolean values
  386. as the right-hand side is deprecated, use ``True`` or ``False`` instead.
  387. * The barely documented ``django.db.models.query_utils.InvalidQuery`` exception
  388. class is deprecated in favor of
  389. :class:`~django.core.exceptions.FieldDoesNotExist` and
  390. :class:`~django.core.exceptions.FieldError`.
  391. * The ``django-admin.py`` entry point is deprecated in favor of
  392. ``django-admin``.
  393. * The ``HttpRequest.is_ajax()`` method is deprecated as it relied on a
  394. jQuery-specific way of signifying AJAX calls, while current usage tends to
  395. use the JavaScript `Fetch API
  396. <https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API>`_. Depending on
  397. your use case, you can either write your own AJAX detection method, or use
  398. the new :meth:`.HttpRequest.accepts` method if your code depends on the
  399. client ``Accept`` HTTP header.
  400. If you are writing your own AJAX detection method, ``request.is_ajax()`` can
  401. be reproduced exactly as
  402. ``request.headers.get('x-requested-with') == 'XMLHttpRequest'``.
  403. * Passing ``None`` as the first argument to
  404. ``django.utils.deprecation.MiddlewareMixin.__init__()`` is deprecated.
  405. * The encoding format of cookies values used by
  406. :class:`~django.contrib.messages.storage.cookie.CookieStorage` is different
  407. from the format generated by older versions of Django. Support for the old
  408. format remains until Django 4.0.
  409. * The encoding format of sessions is different from the format generated by
  410. older versions of Django. Support for the old format remains until Django
  411. 4.0.
  412. * The purely documentational ``providing_args`` argument for
  413. :class:`~django.dispatch.Signal` is deprecated. If you rely on this
  414. argument as documentation, you can move the text to a code comment or
  415. docstring.
  416. * Calling ``django.utils.crypto.get_random_string()`` without a ``length``
  417. argument is deprecated.
  418. * The ``list`` message for :class:`~django.forms.ModelMultipleChoiceField` is
  419. deprecated in favor of ``invalid_list``.
  420. .. _removed-features-3.1:
  421. Features removed in 3.1
  422. =======================
  423. These features have reached the end of their deprecation cycle and are removed
  424. in Django 3.1.
  425. See :ref:`deprecated-features-2.2` for details on these changes, including how
  426. to remove usage of these features.
  427. * ``django.utils.timezone.FixedOffset`` is removed.
  428. * ``django.core.paginator.QuerySetPaginator`` is removed.
  429. * A model's ``Meta.ordering`` doesn't affect ``GROUP BY`` queries.
  430. * ``django.contrib.postgres.fields.FloatRangeField`` and
  431. ``django.contrib.postgres.forms.FloatRangeField`` are removed.
  432. * The ``FILE_CHARSET`` setting is removed.
  433. * ``django.contrib.staticfiles.storage.CachedStaticFilesStorage`` is removed.
  434. * The ``RemoteUserBackend.configure_user()`` method requires ``request`` as the
  435. first positional argument.
  436. * Support for ``SimpleTestCase.allow_database_queries`` and
  437. ``TransactionTestCase.multi_db`` is removed.