4.1.txt 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665
  1. ============================================
  2. Django 4.1 release notes - UNDER DEVELOPMENT
  3. ============================================
  4. *Expected August 2022*
  5. Welcome to Django 4.1!
  6. These release notes cover the :ref:`new features <whats-new-4.1>`, as well as
  7. some :ref:`backwards incompatible changes <backwards-incompatible-4.1>` you'll
  8. want to be aware of when upgrading from Django 4.0 or earlier. We've
  9. :ref:`begun the deprecation process for some features
  10. <deprecated-features-4.1>`.
  11. See the :doc:`/howto/upgrade-version` guide if you're updating an existing
  12. project.
  13. Python compatibility
  14. ====================
  15. Django 4.1 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.1:
  18. What's new in Django 4.1
  19. ========================
  20. Asynchronous handlers for class-based views
  21. -------------------------------------------
  22. View subclasses may now define async HTTP method handlers::
  23. import asyncio
  24. from django.http import HttpResponse
  25. from django.views import View
  26. class AsyncView(View):
  27. async def get(self, request, *args, **kwargs):
  28. # Perform view logic using await.
  29. await asyncio.sleep(1)
  30. return HttpResponse("Hello async world!")
  31. See :ref:`async-class-based-views` for more details.
  32. Asynchronous ORM interface
  33. --------------------------
  34. ``QuerySet`` now provides an asynchronous interface for all data access
  35. operations. These are named as-per the existing synchronous operations but with
  36. an ``a`` prefix, for example ``acreate()``, ``aget()``, and so on.
  37. The new interface allows you to write asynchronous code without needing to wrap
  38. ORM operations in ``sync_to_async()``::
  39. async for author in Author.objects.filter(name__startswith="A"):
  40. book = await author.books.afirst()
  41. Note that, at this stage, the underlying database operations remain
  42. synchronous, with contributions ongoing to push asynchronous support down into
  43. the SQL compiler, and integrate asynchronous database drivers. The new
  44. asynchronous queryset interface currently encapsulates the necessary
  45. ``sync_to_async()`` operations for you, and will allow your code to take
  46. advantage of developments in the ORM's asynchronous support as it evolves.
  47. See :ref:`async-queries` for details and limitations.
  48. .. _csrf-cookie-masked-usage:
  49. ``CSRF_COOKIE_MASKED`` setting
  50. ------------------------------
  51. The new :setting:`CSRF_COOKIE_MASKED` transitional setting allows specifying
  52. whether to mask the CSRF cookie.
  53. :class:`~django.middleware.csrf.CsrfViewMiddleware` no longer masks the CSRF
  54. cookie like it does the CSRF token in the DOM. If you are upgrading multiple
  55. instances of the same project to Django 4.1, you should set
  56. :setting:`CSRF_COOKIE_MASKED` to ``True`` during the transition, in
  57. order to allow compatibility with the older versions of Django. Once the
  58. transition to 4.1 is complete you can stop overriding
  59. :setting:`CSRF_COOKIE_MASKED`.
  60. This setting is deprecated as of this release and will be removed in Django
  61. 5.0.
  62. Minor features
  63. --------------
  64. :mod:`django.contrib.admin`
  65. ~~~~~~~~~~~~~~~~~~~~~~~~~~~
  66. * The admin :ref:`dark mode CSS variables <admin-theming>` are now applied in a
  67. separate stylesheet and template block.
  68. * :ref:`modeladmin-list-filters` providing custom ``FieldListFilter``
  69. subclasses can now control the query string value separator when filtering
  70. for multiple values using the ``__in`` lookup.
  71. * The admin :meth:`history view <django.contrib.admin.ModelAdmin.history_view>`
  72. is now paginated.
  73. * Related widget wrappers now have a link to object's change form.
  74. * The :meth:`.AdminSite.get_app_list` method now allows changing the order of
  75. apps and models on the admin index page.
  76. :mod:`django.contrib.admindocs`
  77. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  78. * ...
  79. :mod:`django.contrib.auth`
  80. ~~~~~~~~~~~~~~~~~~~~~~~~~~
  81. * The default iteration count for the PBKDF2 password hasher is increased from
  82. 320,000 to 390,000.
  83. * The :meth:`.RemoteUserBackend.configure_user` method now allows synchronizing
  84. user attributes with attributes in a remote system such as an LDAP directory.
  85. :mod:`django.contrib.contenttypes`
  86. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  87. * ...
  88. :mod:`django.contrib.gis`
  89. ~~~~~~~~~~~~~~~~~~~~~~~~~
  90. * The new :meth:`.GEOSGeometry.make_valid()` method allows converting invalid
  91. geometries to valid ones.
  92. :mod:`django.contrib.messages`
  93. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  94. * ...
  95. :mod:`django.contrib.postgres`
  96. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  97. * The new :class:`BitXor() <django.contrib.postgres.aggregates.BitXor>`
  98. aggregate function returns an ``int`` of the bitwise ``XOR`` of all non-null
  99. input values.
  100. * :class:`~django.contrib.postgres.indexes.SpGistIndex` now supports covering
  101. indexes on PostgreSQL 14+.
  102. * :class:`~django.contrib.postgres.constraints.ExclusionConstraint` now
  103. supports covering exclusion constraints using SP-GiST indexes on PostgreSQL
  104. 14+.
  105. * The new ``default_bounds`` attribute of :attr:`DateTimeRangeField
  106. <django.contrib.postgres.fields.DateTimeRangeField.default_bounds>` and
  107. :attr:`DecimalRangeField
  108. <django.contrib.postgres.fields.DecimalRangeField.default_bounds>` allows
  109. specifying bounds for list and tuple inputs.
  110. * :class:`~django.contrib.postgres.constraints.ExclusionConstraint` now allows
  111. specifying operator classes with the
  112. :class:`OpClass() <django.contrib.postgres.indexes.OpClass>` expression.
  113. :mod:`django.contrib.redirects`
  114. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  115. * ...
  116. :mod:`django.contrib.sessions`
  117. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  118. * ...
  119. :mod:`django.contrib.sitemaps`
  120. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  121. * The default sitemap index template ``<sitemapindex>`` now includes the
  122. ``<lastmod>`` timestamp where available, through the new
  123. :meth:`~django.contrib.sitemaps.Sitemap.get_latest_lastmod` method. Custom
  124. sitemap index templates should be updated for the adjusted :ref:`context
  125. variables <sitemap-index-context-variables>`.
  126. :mod:`django.contrib.sites`
  127. ~~~~~~~~~~~~~~~~~~~~~~~~~~~
  128. * ...
  129. :mod:`django.contrib.staticfiles`
  130. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  131. * :class:`~django.contrib.staticfiles.storage.ManifestStaticFilesStorage` now
  132. replaces paths to CSS source map references with their hashed counterparts.
  133. :mod:`django.contrib.syndication`
  134. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  135. * ...
  136. Cache
  137. ~~~~~
  138. * ...
  139. CSRF
  140. ~~~~
  141. * ...
  142. Database backends
  143. ~~~~~~~~~~~~~~~~~
  144. * Third-party database backends can now specify the minimum required version of
  145. the database using the ``DatabaseFeatures.minimum_database_version``
  146. attribute which is a tuple (e.g. ``(10, 0)`` means "10.0"). If a minimum
  147. version is specified, backends must also implement
  148. ``DatabaseWrapper.get_database_version()``, which returns a tuple of the
  149. current database version. The backend's
  150. ``DatabaseWrapper.init_connection_state()`` method must call ``super()`` in
  151. order for the check to run.
  152. Decorators
  153. ~~~~~~~~~~
  154. * ...
  155. Email
  156. ~~~~~
  157. * ...
  158. Error Reporting
  159. ~~~~~~~~~~~~~~~
  160. * ...
  161. File Storage
  162. ~~~~~~~~~~~~
  163. * ...
  164. File Uploads
  165. ~~~~~~~~~~~~
  166. * ...
  167. Forms
  168. ~~~~~
  169. * The new :meth:`~django.forms.BoundField.legend_tag` allows rendering field
  170. labels in ``<legend>`` tags via the new ``tag`` argument of
  171. :meth:`~django.forms.BoundField.label_tag`.
  172. * The new ``edit_only`` argument for :func:`.modelformset_factory` and
  173. :func:`.inlineformset_factory` allows preventing new objects creation.
  174. * The ``js`` and ``css`` class attributes of :doc:`Media </topics/forms/media>`
  175. now allow using hashable objects, not only path strings, as long as those
  176. objects implement the ``__html__()`` method (typically when decorated with
  177. the :func:`~django.utils.html.html_safe` decorator).
  178. * The new :attr:`.BoundField.use_fieldset` and :attr:`.Widget.use_fieldset`
  179. attributes help to identify widgets where its inputs should be grouped in a
  180. ``<fieldset>`` with a ``<legend>``.
  181. Generic Views
  182. ~~~~~~~~~~~~~
  183. * ...
  184. Internationalization
  185. ~~~~~~~~~~~~~~~~~~~~
  186. * The :func:`~django.conf.urls.i18n.i18n_patterns` function now supports
  187. languages with both scripts and regions.
  188. Logging
  189. ~~~~~~~
  190. * ...
  191. Management Commands
  192. ~~~~~~~~~~~~~~~~~~~
  193. * :option:`makemigrations --no-input` now logs default answers and reasons why
  194. migrations cannot be created.
  195. * The new :option:`makemigrations --scriptable` option diverts log output and
  196. input prompts to ``stderr``, writing only paths of generated migration files
  197. to ``stdout``.
  198. * The new :option:`migrate --prune` option allows deleting nonexistent
  199. migrations from the ``django_migrations`` table.
  200. * Python files created by :djadmin:`startproject`, :djadmin:`startapp`,
  201. :djadmin:`optimizemigration`, :djadmin:`makemigrations`, and
  202. :djadmin:`squashmigrations` are now formatted using the ``black`` command if
  203. it is present on your ``PATH``.
  204. * The new :djadmin:`optimizemigration` command allows optimizing operations for
  205. a migration.
  206. Migrations
  207. ~~~~~~~~~~
  208. * ...
  209. Models
  210. ~~~~~~
  211. * The ``order_by`` argument of the
  212. :class:`~django.db.models.expressions.Window` expression now accepts string
  213. references to fields and transforms.
  214. * The new :setting:`CONN_HEALTH_CHECKS` setting allows enabling health checks
  215. for :ref:`persistent database connections <persistent-database-connections>`
  216. in order to reduce the number of failed requests, e.g. after database server
  217. restart.
  218. * :meth:`.QuerySet.bulk_create` now supports updating fields when a row
  219. insertion fails uniqueness constraints. This is supported on MariaDB, MySQL,
  220. PostgreSQL, and SQLite 3.24+.
  221. * :meth:`.QuerySet.iterator` now supports prefetching related objects as long
  222. as the ``chunk_size`` argument is provided. In older versions, no prefetching
  223. was done.
  224. * :class:`~django.db.models.Q` objects and querysets can now be combined using
  225. ``^`` as the exclusive or (``XOR``) operator. ``XOR`` is natively supported
  226. on MariaDB and MySQL. For databases that do not support ``XOR``, the query
  227. will be converted to an equivalent using ``AND``, ``OR``, and ``NOT``.
  228. * The new :ref:`Field.non_db_attrs <custom-field-non_db_attrs>` attribute
  229. allows customizing attributes of fields that don't affect a column
  230. definition.
  231. * On PostgreSQL, ``AutoField``, ``BigAutoField``, and ``SmallAutoField`` are
  232. now created as identity columns rather than serial columns with sequences.
  233. Requests and Responses
  234. ~~~~~~~~~~~~~~~~~~~~~~
  235. * :meth:`.HttpResponse.set_cookie` now supports :class:`~datetime.timedelta`
  236. objects for the ``max_age`` argument.
  237. Security
  238. ~~~~~~~~
  239. * The new :setting:`SECRET_KEY_FALLBACKS` setting allows providing a list of
  240. values for secret key rotation.
  241. * The :setting:`SECURE_PROXY_SSL_HEADER` setting now supports a comma-separated
  242. list of protocols in the header value.
  243. Serialization
  244. ~~~~~~~~~~~~~
  245. * ...
  246. Signals
  247. ~~~~~~~
  248. * The :data:`~django.db.models.signals.pre_delete` and
  249. :data:`~django.db.models.signals.post_delete` signals now dispatch the
  250. ``origin`` of the deletion.
  251. .. _templates-4.1:
  252. Templates
  253. ~~~~~~~~~
  254. * :tfilter:`json_script` template filter now allows wrapping in a ``<script>``
  255. tag without the HTML ``id`` attribute.
  256. * The :class:`cached template loader <django.template.loaders.cached.Loader>`
  257. is now enabled in development, when :setting:`DEBUG` is ``True``, and
  258. :setting:`OPTIONS['loaders'] <TEMPLATES-OPTIONS>` isn't specified. You may
  259. specify ``OPTIONS['loaders']`` to override this, if necessary.
  260. Tests
  261. ~~~~~
  262. * The :class:`.DiscoverRunner` now supports running tests in parallel on
  263. macOS, Windows, and any other systems where the default
  264. :mod:`multiprocessing` start method is ``spawn``.
  265. * A nested atomic block marked as durable in :class:`django.test.TestCase` now
  266. raises a ``RuntimeError``, the same as outside of tests.
  267. * :meth:`.SimpleTestCase.assertFormError` and
  268. :meth:`~.SimpleTestCase.assertFormsetError` now support passing a
  269. form/formset object directly.
  270. URLs
  271. ~~~~
  272. * The new :attr:`.ResolverMatch.captured_kwargs` attribute stores the captured
  273. keyword arguments, as parsed from the URL.
  274. * The new :attr:`.ResolverMatch.extra_kwargs` attribute stores the additional
  275. keyword arguments passed to the view function.
  276. Utilities
  277. ~~~~~~~~~
  278. * ``SimpleLazyObject`` now supports addition operations.
  279. * :func:`~django.utils.safestring.mark_safe` now preserves lazy objects.
  280. Validators
  281. ~~~~~~~~~~
  282. * ...
  283. .. _backwards-incompatible-4.1:
  284. Backwards incompatible changes in 4.1
  285. =====================================
  286. Database backend API
  287. --------------------
  288. This section describes changes that may be needed in third-party database
  289. backends.
  290. * ``BaseDatabaseFeatures.has_case_insensitive_like`` is changed from ``True``
  291. to ``False`` to reflect the behavior of most databases.
  292. * ``DatabaseIntrospection.get_key_columns()`` is removed. Use
  293. ``DatabaseIntrospection.get_relations()`` instead.
  294. * ``DatabaseOperations.ignore_conflicts_suffix_sql()`` method is replaced by
  295. ``DatabaseOperations.on_conflict_suffix_sql()`` that accepts the ``fields``,
  296. ``on_conflict``, ``update_fields``, and ``unique_fields`` arguments.
  297. * The ``ignore_conflicts`` argument of the
  298. ``DatabaseOperations.insert_statement()`` method is replaced by
  299. ``on_conflict`` that accepts ``django.db.models.constants.OnConflict``.
  300. :mod:`django.contrib.gis`
  301. -------------------------
  302. * Support for GDAL 2.1 is removed.
  303. Dropped support for MariaDB 10.2
  304. --------------------------------
  305. Upstream support for MariaDB 10.2 ends in May 2022. Django 4.1 supports MariaDB
  306. 10.3 and higher.
  307. Admin changelist searches spanning multi-valued relationships changes
  308. ---------------------------------------------------------------------
  309. Admin changelist searches using multiple search terms are now applied in a
  310. single call to ``filter()``, rather than in sequential ``filter()`` calls.
  311. For multi-valued relationships, this means that rows from the related model
  312. must match all terms rather than any term. For example, if ``search_fields``
  313. is set to ``['child__name', 'child__age']``, and a user searches for
  314. ``'Jamal 17'``, parent rows will be returned only if there is a relationship to
  315. some 17-year-old child named Jamal, rather than also returning parents who
  316. merely have a younger or older child named Jamal in addition to some other
  317. 17-year-old.
  318. See the :ref:`spanning-multi-valued-relationships` topic for more discussion of
  319. this difference. In Django 4.0 and earlier,
  320. :meth:`~django.contrib.admin.ModelAdmin.get_search_results` followed the
  321. second example query, but this undocumented behavior led to queries with
  322. excessive joins.
  323. Reverse foreign key changes for unsaved model instances
  324. -------------------------------------------------------
  325. In order to unify the behavior with many-to-many relations for unsaved model
  326. instances, a reverse foreign key now raises ``ValueError`` when calling
  327. :class:`related managers <django.db.models.fields.related.RelatedManager>` for
  328. unsaved objects.
  329. Miscellaneous
  330. -------------
  331. * Related managers for :class:`~django.db.models.ForeignKey`,
  332. :class:`~django.db.models.ManyToManyField`, and
  333. :class:`~django.contrib.contenttypes.fields.GenericRelation` are now cached
  334. on the :class:`~django.db.models.Model` instance to which they belong.
  335. * The Django test runner now returns a non-zero error code for unexpected
  336. successes from tests marked with :py:func:`unittest.expectedFailure`.
  337. * :class:`~django.middleware.csrf.CsrfViewMiddleware` no longer masks the CSRF
  338. cookie like it does the CSRF token in the DOM.
  339. * :class:`~django.middleware.csrf.CsrfViewMiddleware` now uses
  340. ``request.META['CSRF_COOKIE']`` for storing the unmasked CSRF secret rather
  341. than a masked version. This is an undocumented, private API.
  342. * The :attr:`.ModelAdmin.actions` and
  343. :attr:`~django.contrib.admin.ModelAdmin.inlines` attributes now default to an
  344. empty tuple rather than an empty list to discourage unintended mutation.
  345. * The ``type="text/css"`` attribute is no longer included in ``<link>`` tags
  346. for CSS :doc:`form media </topics/forms/media>`.
  347. * ``formset:added`` and ``formset:removed`` JavaScript events are now pure
  348. JavaScript events and don't depend on jQuery. See
  349. :ref:`admin-javascript-inline-form-events` for more details on the change.
  350. * The ``exc_info`` argument of the undocumented
  351. ``django.utils.log.log_response()`` function is replaced by ``exception``.
  352. * The ``size`` argument of the undocumented
  353. ``django.views.static.was_modified_since()`` function is removed.
  354. * The admin log out UI now uses ``POST`` requests.
  355. * The undocumented ``InlineAdminFormSet.non_form_errors`` property is replaced
  356. by the ``non_form_errors()`` method. This is consistent with ``BaseFormSet``.
  357. * As per :ref:`above<templates-4.1>`, the cached template loader is now
  358. enabled in development. You may specify ``OPTIONS['loaders']`` to override
  359. this, if necessary.
  360. * The undocumented ``django.contrib.auth.views.SuccessURLAllowedHostsMixin``
  361. mixin is replaced by ``RedirectURLMixin``.
  362. .. _deprecated-features-4.1:
  363. Features deprecated in 4.1
  364. ==========================
  365. Log out via GET
  366. ---------------
  367. Logging out via ``GET`` requests to the :py:class:`built-in logout view
  368. <django.contrib.auth.views.LogoutView>` is deprecated. Use ``POST`` requests
  369. instead.
  370. If you want to retain the user experience of an HTML link, you can use a form
  371. that is styled to appear as a link:
  372. .. code-block:: html
  373. <form id="logout-form" method="post" action="{% url 'admin:logout' %}">
  374. {% csrf_token %}
  375. <button type="submit">{% translate "Log out" %}</button>
  376. </form>
  377. .. code-block:: css
  378. #logout-form {
  379. display: inline;
  380. }
  381. #logout-form button {
  382. background: none;
  383. border: none;
  384. cursor: pointer;
  385. padding: 0;
  386. text-decoration: underline;
  387. }
  388. Miscellaneous
  389. -------------
  390. * The context for sitemap index templates of a flat list of URLs is deprecated.
  391. Custom sitemap index templates should be updated for the adjusted
  392. :ref:`context variables <sitemap-index-context-variables>`, expecting a list
  393. of objects with ``location`` and optional ``lastmod`` attributes.
  394. * ``CSRF_COOKIE_MASKED`` transitional setting is deprecated.
  395. * The ``name`` argument of :func:`django.utils.functional.cached_property` is
  396. deprecated as it's unnecessary as of Python 3.6.
  397. * The ``opclasses`` argument of
  398. ``django.contrib.postgres.constraints.ExclusionConstraint`` is deprecated in
  399. favor of using :class:`OpClass() <django.contrib.postgres.indexes.OpClass>`
  400. in :attr:`.ExclusionConstraint.expressions`. To use it, you need to add
  401. ``'django.contrib.postgres'`` in your :setting:`INSTALLED_APPS`.
  402. After making this change, :djadmin:`makemigrations` will generate a new
  403. migration with two operations: ``RemoveConstraint`` and ``AddConstraint``.
  404. Since this change has no effect on the database schema,
  405. the :class:`~django.db.migrations.operations.SeparateDatabaseAndState`
  406. operation can be used to only update the migration state without running any
  407. SQL. Move the generated operations into the ``state_operations`` argument of
  408. :class:`~django.db.migrations.operations.SeparateDatabaseAndState`. For
  409. example::
  410. class Migration(migrations.Migration):
  411. ...
  412. operations = [
  413. migrations.SeparateDatabaseAndState(
  414. database_operations=[],
  415. state_operations=[
  416. migrations.RemoveConstraint(
  417. ...
  418. ),
  419. migrations.AddConstraint(
  420. ...
  421. ),
  422. ],
  423. ),
  424. ]
  425. * The undocumented ability to pass ``errors=None`` to
  426. :meth:`.SimpleTestCase.assertFormError` and
  427. :meth:`~.SimpleTestCase.assertFormsetError` is deprecated. Use ``errors=[]``
  428. instead.
  429. * ``django.contrib.sessions.serializers.PickleSerializer`` is deprecated due to
  430. the risk of remote code execution.
  431. * The usage of ``QuerySet.iterator()`` on a queryset that prefetches related
  432. objects without providing the ``chunk_size`` argument is deprecated. In older
  433. versions, no prefetching was done. Providing a value for ``chunk_size``
  434. signifies that the additional query per chunk needed to prefetch is desired.
  435. * Passing unsaved model instances to related filters is deprecated. In Django
  436. 5.0, the exception will be raised.
  437. * ``created=True`` is added to the signature of
  438. :meth:`.RemoteUserBackend.configure_user`. Support for ``RemoteUserBackend``
  439. subclasses that do not accept this argument is deprecated.
  440. * The :data:`django.utils.timezone.utc` alias to :attr:`datetime.timezone.utc`
  441. is deprecated. Use :attr:`datetime.timezone.utc` directly.
  442. * Passing a response object and a form/formset name to
  443. ``SimpleTestCase.assertFormError()`` and ``assertFormsetError()`` is
  444. deprecated. Use::
  445. assertFormError(response.context['form_name'], …)
  446. assertFormsetError(response.context['formset_name'], …)
  447. or pass the form/formset object directly instead.
  448. * The undocumented ``django.contrib.gis.admin.OpenLayersWidget`` is deprecated.
  449. Features removed in 4.1
  450. =======================
  451. These features have reached the end of their deprecation cycle and are removed
  452. in Django 4.1.
  453. See :ref:`deprecated-features-3.2` for details on these changes, including how
  454. to remove usage of these features.
  455. * Support for assigning objects which don't support creating deep copies with
  456. ``copy.deepcopy()`` to class attributes in ``TestCase.setUpTestData()`` is
  457. removed.
  458. * Support for using a boolean value in
  459. :attr:`.BaseCommand.requires_system_checks` is removed.
  460. * The ``whitelist`` argument and ``domain_whitelist`` attribute of
  461. ``django.core.validators.EmailValidator`` are removed.
  462. * The ``default_app_config`` application configuration variable is removed.
  463. * ``TransactionTestCase.assertQuerysetEqual()`` no longer calls ``repr()`` on a
  464. queryset when compared to string values.
  465. * The ``django.core.cache.backends.memcached.MemcachedCache`` backend is
  466. removed.
  467. * Support for the pre-Django 3.2 format of messages used by
  468. ``django.contrib.messages.storage.cookie.CookieStorage`` is removed.