{"title":"Django 3.1 release notes","version":"dev","locale":"en","docname":"releases/3.1","url":"/en/dev/releases/3.1/","canonical":"https://djangodocs.dev/en/dev/releases/3.1/","summary":"Welcome to Django 3.1! These release notes cover the new features, as well as some backwards incompatible changes you’ll want to be aware of when upgrading…","html":"<h1>Django 3.1 release notes<a class=\"heading-anchor\" href=\"#django-3-1-release-notes\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h1>\n<p><em>August 4, 2020</em></p>\n<p>Welcome to Django 3.1!</p>\n<p>These release notes cover the <a class=\"reference internal\" href=\"#whats-new-3-1\"><span class=\"std std-ref\">new features</span></a>, as well as\nsome <a class=\"reference internal\" href=\"#backwards-incompatible-3-1\"><span class=\"std std-ref\">backwards incompatible changes</span></a> you’ll\nwant to be aware of when upgrading from Django 3.0 or earlier. We’ve\n<a class=\"reference internal\" href=\"#removed-features-3-1\"><span class=\"std std-ref\">dropped some features</span></a> that have reached the end of\ntheir deprecation cycle, and we’ve <a class=\"reference internal\" href=\"#deprecated-features-3-1\"><span class=\"std std-ref\">begun the deprecation process for\nsome features</span></a>.</p>\n<p>See the <a class=\"reference internal\" href=\"/en/dev/howto/upgrade-version/\"><span class=\"doc\">How to upgrade Django to a newer version</span></a> guide if you’re updating an existing\nproject.</p>\n<section id=\"python-compatibility\">\n<h2>Python compatibility<a class=\"heading-anchor\" href=\"#python-compatibility\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h2>\n<p>Django 3.1 supports Python 3.6, 3.7, 3.8, and 3.9 (as of 3.1.3). We <strong>highly\nrecommend</strong> and only officially support the latest release of each series.</p>\n</section>\n<section id=\"what-s-new-in-django-3-1\">\n<span id=\"whats-new-3-1\"></span><h2>What’s new in Django 3.1<a class=\"heading-anchor\" href=\"#what-s-new-in-django-3-1\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h2>\n<section id=\"asynchronous-views-and-middleware-support\">\n<h3>Asynchronous views and middleware support<a class=\"heading-anchor\" href=\"#asynchronous-views-and-middleware-support\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h3>\n<p>Django now supports a fully asynchronous request path, including:</p>\n<ul class=\"simple\">\n<li><p><a class=\"reference internal\" href=\"/en/dev/topics/http/views/#async-views\"><span class=\"std std-ref\">Asynchronous views</span></a></p></li>\n<li><p><a class=\"reference internal\" href=\"/en/dev/topics/http/middleware/#async-middleware\"><span class=\"std std-ref\">Asynchronous middleware</span></a></p></li>\n<li><p><a class=\"reference internal\" href=\"/en/dev/topics/testing/tools/#async-tests\"><span class=\"std std-ref\">Asynchronous tests and test client</span></a></p></li>\n</ul>\n<p>To get started with async views, you need to declare a view using\n<code class=\"docutils literal notranslate\">async def</code>:</p>\n<div class=\"code-block\" data-language=\"default\"><div class=\"code-block-toolbar\"><span class=\"code-block-language\">Code</span><button type=\"button\" class=\"copy-button\" data-copy hidden><span class=\"copy-button-label\">Copy</span></button></div><pre role=\"group\" tabindex=\"0\" aria-label=\"Code code\"><code><span class=\"k\">async</span> <span class=\"k\">def</span> <span class=\"nf\">my_view</span><span class=\"p\">(</span>request<span class=\"p\">):</span>\n    <span class=\"k\">await</span> asyncio<span class=\"o\">.</span>sleep<span class=\"p\">(</span><span class=\"mf\">0.5</span><span class=\"p\">)</span>\n    <span class=\"k\">return</span> HttpResponse<span class=\"p\">(</span><span class=\"s2\">&quot;Hello, async world!&quot;</span><span class=\"p\">)</span>\n</code></pre></div>\n<p>All asynchronous features are supported whether you are running under WSGI or\nASGI mode. However, there will be performance penalties using async code in\nWSGI mode. You can read more about the specifics in <a class=\"reference internal\" href=\"/en/dev/topics/async/\"><span class=\"doc\">Asynchronous support</span></a>\ndocumentation.</p>\n<p>You are free to mix async and sync views, middleware, and tests as much as you\nwant. Django will ensure that you always end up with the right execution\ncontext. We expect most projects will keep the majority of their views\nsynchronous, and only have a select few running in async mode - but it is\nentirely your choice.</p>\n<p>Django’s ORM, cache layer, and other pieces of code that do long-running\nnetwork calls do not yet support async access. We expect to add support for\nthem in upcoming releases. Async views are ideal, however, if you are doing a\nlot of API or HTTP calls inside your view, you can now natively do all those\nHTTP calls in parallel to considerably speed up your view’s execution.</p>\n<p>Asynchronous support should be entirely backwards-compatible and we have tried\nto ensure that it has no speed regressions for your existing, synchronous code.\nIt should have no noticeable effect on any existing Django projects.</p>\n</section>\n<section id=\"jsonfield-for-all-supported-database-backends\">\n<h3>JSONField for all supported database backends<a class=\"heading-anchor\" href=\"#jsonfield-for-all-supported-database-backends\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h3>\n<p>Django now includes <a class=\"reference internal\" href=\"/en/dev/ref/models/fields/#django.db.models.JSONField\" title=\"django.db.models.JSONField\"><code class=\"xref py py-class docutils literal notranslate\">models.JSONField</code></a> and\n<a class=\"reference internal\" href=\"/en/dev/ref/forms/fields/#django.forms.JSONField\" title=\"django.forms.JSONField\"><code class=\"xref py py-class docutils literal notranslate\">forms.JSONField</code></a> that can be used on all\nsupported database backends. Both fields support the use of custom JSON\nencoders and decoders. The model field supports the introspection,\n<a class=\"reference internal\" href=\"/en/dev/topics/db/queries/#querying-jsonfield\"><span class=\"std std-ref\">lookups, and transforms</span></a> that were previously\nPostgreSQL-only:</p>\n<div class=\"code-block\" data-language=\"default\"><div class=\"code-block-toolbar\"><span class=\"code-block-language\">Code</span><button type=\"button\" class=\"copy-button\" data-copy hidden><span class=\"copy-button-label\">Copy</span></button></div><pre role=\"group\" tabindex=\"0\" aria-label=\"Code code\"><code><span class=\"kn\">from</span> <span class=\"nn\">django.db</span> <span class=\"kn\">import</span> models\n\n\n<span class=\"k\">class</span> <span class=\"nc\">ContactInfo</span><span class=\"p\">(</span>models<span class=\"o\">.</span>Model<span class=\"p\">):</span>\n    data <span class=\"o\">=</span> models<span class=\"o\">.</span>JSONField<span class=\"p\">()</span>\n\n\nContactInfo<span class=\"o\">.</span>objects<span class=\"o\">.</span>create<span class=\"p\">(</span>\n    data<span class=\"o\">=</span><span class=\"p\">{</span>\n        <span class=\"s2\">&quot;name&quot;</span><span class=\"p\">:</span> <span class=\"s2\">&quot;John&quot;</span><span class=\"p\">,</span>\n        <span class=\"s2\">&quot;cities&quot;</span><span class=\"p\">:</span> <span class=\"p\">[</span><span class=\"s2\">&quot;London&quot;</span><span class=\"p\">,</span> <span class=\"s2\">&quot;Cambridge&quot;</span><span class=\"p\">],</span>\n        <span class=\"s2\">&quot;pets&quot;</span><span class=\"p\">:</span> <span class=\"p\">{</span><span class=\"s2\">&quot;dogs&quot;</span><span class=\"p\">:</span> <span class=\"p\">[</span><span class=\"s2\">&quot;Rufus&quot;</span><span class=\"p\">,</span> <span class=\"s2\">&quot;Meg&quot;</span><span class=\"p\">]},</span>\n    <span class=\"p\">}</span>\n<span class=\"p\">)</span>\nContactInfo<span class=\"o\">.</span>objects<span class=\"o\">.</span>filter<span class=\"p\">(</span>\n    data__name<span class=\"o\">=</span><span class=\"s2\">&quot;John&quot;</span><span class=\"p\">,</span>\n    data__pets__has_key<span class=\"o\">=</span><span class=\"s2\">&quot;dogs&quot;</span><span class=\"p\">,</span>\n    data__cities__contains<span class=\"o\">=</span><span class=\"s2\">&quot;London&quot;</span><span class=\"p\">,</span>\n<span class=\"p\">)</span><span class=\"o\">.</span>delete<span class=\"p\">()</span>\n</code></pre></div>\n<p>If your project uses <code class=\"docutils literal notranslate\">django.contrib.postgres.fields.JSONField</code>, plus the\nrelated form field and transforms, you should adjust to use the new fields,\nand generate and apply a database migration. For now, the old fields and\ntransforms are left as a reference to the new ones and are <a class=\"reference internal\" href=\"#deprecated-jsonfield\"><span class=\"std std-ref\">deprecated as\nof this release</span></a>.</p>\n</section>\n<section id=\"default-hashing-algorithm-settings\">\n<span id=\"default-hashing-algorithm-usage\"></span><h3><code class=\"docutils literal notranslate\">DEFAULT_HASHING_ALGORITHM</code> settings<a class=\"heading-anchor\" href=\"#default-hashing-algorithm-settings\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h3>\n<p>The new <code class=\"docutils literal notranslate\">DEFAULT_HASHING_ALGORITHM</code> transitional setting allows specifying\nthe default hashing algorithm to use for encoding cookies, password reset\ntokens in the admin site, user sessions, and signatures created by\n<a class=\"reference internal\" href=\"/en/dev/topics/signing/#django.core.signing.Signer\" title=\"django.core.signing.Signer\"><code class=\"xref py py-class docutils literal notranslate\">django.core.signing.Signer</code></a> and <a class=\"reference internal\" href=\"/en/dev/topics/signing/#django.core.signing.dumps\" title=\"django.core.signing.dumps\"><code class=\"xref py py-meth docutils literal notranslate\">django.core.signing.dumps()</code></a>.</p>\n<p>Support for SHA-256 was added in Django 3.1. If you are upgrading multiple\ninstances of the same project to Django 3.1, you should set\n<code class=\"docutils literal notranslate\">DEFAULT_HASHING_ALGORITHM</code> to <code class=\"docutils literal notranslate\">'sha1'</code> during the transition, in order to\nallow compatibility with the older versions of Django. Note that this requires\nDjango 3.1.1+. Once the transition to 3.1 is complete you can stop overriding\n<code class=\"docutils literal notranslate\">DEFAULT_HASHING_ALGORITHM</code>.</p>\n<p>This setting is deprecated as of this release, because support for tokens,\ncookies, sessions, and signatures that use SHA-1 algorithm will be removed in\nDjango 4.0.</p>\n</section>\n<section id=\"minor-features\">\n<h3>Minor features<a class=\"heading-anchor\" href=\"#minor-features\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h3>\n<section id=\"django-contrib-admin\">\n<h4><a class=\"reference internal\" href=\"/en/dev/ref/contrib/admin/#module-django.contrib.admin\" title=\"django.contrib.admin: Django's admin site.\"><code class=\"xref py py-mod docutils literal notranslate\">django.contrib.admin</code></a><a class=\"heading-anchor\" href=\"#django-contrib-admin\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h4>\n<ul>\n<li><p>The new <code class=\"docutils literal notranslate\">django.contrib.admin.EmptyFieldListFilter</code> for\n<a class=\"reference internal\" href=\"/en/dev/ref/contrib/admin/#django.contrib.admin.ModelAdmin.list_filter\" title=\"django.contrib.admin.ModelAdmin.list_filter\"><code class=\"xref py py-attr docutils literal notranslate\">ModelAdmin.list_filter</code></a> allows filtering on empty values (empty\nstrings and nulls) in the admin changelist view.</p></li>\n<li><p>Filters in the right sidebar of the admin changelist view now contain a link\nto clear all filters.</p></li>\n<li><p>The admin now has a sidebar on larger screens for easier navigation. It is\nenabled by default but can be disabled by using a custom <code class=\"docutils literal notranslate\">AdminSite</code> and\nsetting <a class=\"reference internal\" href=\"/en/dev/ref/contrib/admin/#django.contrib.admin.AdminSite.enable_nav_sidebar\" title=\"django.contrib.admin.AdminSite.enable_nav_sidebar\"><code class=\"xref py py-attr docutils literal notranslate\">AdminSite.enable_nav_sidebar</code></a> to <code class=\"docutils literal notranslate\">False</code>.</p>\n<p>Rendering the sidebar requires access to the current request in order to set\nCSS and ARIA role affordances. This requires using\n<code class=\"docutils literal notranslate\">'django.template.context_processors.request'</code> in the\n<code class=\"docutils literal notranslate\">'context_processors'</code> option of <a class=\"reference internal\" href=\"/en/dev/ref/settings/#std-setting-TEMPLATES-OPTIONS\"><code class=\"xref std std-setting docutils literal notranslate\">OPTIONS</code></a>.</p>\n</li>\n<li><p>Initially empty <code class=\"docutils literal notranslate\">extra</code> inlines can now be removed, in the same way as\ndynamically created ones.</p></li>\n<li><p><code class=\"docutils literal notranslate\">XRegExp</code> is upgraded from version 2.0.0 to 3.2.0.</p></li>\n<li><p>jQuery is upgraded from version 3.4.1 to 3.5.1.</p></li>\n<li><p>Select2 library is upgraded from version 4.0.7 to 4.0.13.</p></li>\n</ul>\n</section>\n<section id=\"django-contrib-auth\">\n<h4><a class=\"reference internal\" href=\"/en/dev/topics/auth/#module-django.contrib.auth\" title=\"django.contrib.auth: Django's authentication framework.\"><code class=\"xref py py-mod docutils literal notranslate\">django.contrib.auth</code></a><a class=\"heading-anchor\" href=\"#django-contrib-auth\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h4>\n<ul class=\"simple\">\n<li><p>The default iteration count for the PBKDF2 password hasher is increased from\n180,000 to 216,000.</p></li>\n<li><p>The new <a class=\"reference internal\" href=\"/en/dev/ref/settings/#std-setting-PASSWORD_RESET_TIMEOUT\"><code class=\"xref std std-setting docutils literal notranslate\">PASSWORD_RESET_TIMEOUT</code></a> setting allows defining the number\nof seconds a password reset link is valid for. This is encouraged instead of\nthe deprecated <code class=\"docutils literal notranslate\">PASSWORD_RESET_TIMEOUT_DAYS</code> setting, which will be removed\nin Django 4.0.</p></li>\n<li><p>The password reset mechanism now uses the SHA-256 hashing algorithm. Support\nfor tokens that use the old hashing algorithm remains until Django 4.0.</p></li>\n<li><p><a class=\"reference internal\" href=\"/en/dev/topics/auth/customizing/#django.contrib.auth.models.AbstractBaseUser.get_session_auth_hash\" title=\"django.contrib.auth.models.AbstractBaseUser.get_session_auth_hash\"><code class=\"xref py py-meth docutils literal notranslate\">AbstractBaseUser.get_session_auth_hash()</code></a> now uses the SHA-256 hashing\nalgorithm. Support for user sessions that use the old hashing algorithm\nremains until Django 4.0.</p></li>\n</ul>\n</section>\n<section id=\"django-contrib-contenttypes\">\n<h4><a class=\"reference internal\" href=\"/en/dev/ref/contrib/contenttypes/#module-django.contrib.contenttypes\" title=\"django.contrib.contenttypes: Provides generic interface to installed models.\"><code class=\"xref py py-mod docutils literal notranslate\">django.contrib.contenttypes</code></a><a class=\"heading-anchor\" href=\"#django-contrib-contenttypes\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h4>\n<ul class=\"simple\">\n<li><p>The new <a class=\"reference internal\" href=\"/en/dev/ref/django-admin/#cmdoption-remove_stale_contenttypes-include-stale-apps\"><code class=\"xref std std-option docutils literal notranslate\">remove_stale_contenttypes --include-stale-apps</code></a> option\nallows removing stale content types from previously installed apps that have\nbeen removed from <a class=\"reference internal\" href=\"/en/dev/ref/settings/#std-setting-INSTALLED_APPS\"><code class=\"xref std std-setting docutils literal notranslate\">INSTALLED_APPS</code></a>.</p></li>\n</ul>\n</section>\n<section id=\"django-contrib-gis\">\n<h4><a class=\"reference internal\" href=\"/en/dev/ref/contrib/gis/#module-django.contrib.gis\" title=\"django.contrib.gis: Geographic Information System (GIS) extensions for Django\"><code class=\"xref py py-mod docutils literal notranslate\">django.contrib.gis</code></a><a class=\"heading-anchor\" href=\"#django-contrib-gis\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h4>\n<ul class=\"simple\">\n<li><p><a class=\"reference internal\" href=\"/en/dev/ref/contrib/gis/geoquerysets/#std-fieldlookup-relate\"><code class=\"xref std std-lookup docutils literal notranslate\">relate</code></a> lookup is now supported on MariaDB.</p></li>\n<li><p>Added the <a class=\"reference internal\" href=\"/en/dev/ref/contrib/gis/geos/#django.contrib.gis.geos.LinearRing.is_counterclockwise\" title=\"django.contrib.gis.geos.LinearRing.is_counterclockwise\"><code class=\"xref py py-attr docutils literal notranslate\">LinearRing.is_counterclockwise</code></a> property.</p></li>\n<li><p><a class=\"reference internal\" href=\"/en/dev/ref/contrib/gis/functions/#django.contrib.gis.db.models.functions.AsGeoJSON\" title=\"django.contrib.gis.db.models.functions.AsGeoJSON\"><code class=\"xref py py-class docutils literal notranslate\">AsGeoJSON</code></a> is now supported\non Oracle.</p></li>\n<li><p>Added the <a class=\"reference internal\" href=\"/en/dev/ref/contrib/gis/functions/#django.contrib.gis.db.models.functions.AsWKB\" title=\"django.contrib.gis.db.models.functions.AsWKB\"><code class=\"xref py py-class docutils literal notranslate\">AsWKB</code></a> and\n<a class=\"reference internal\" href=\"/en/dev/ref/contrib/gis/functions/#django.contrib.gis.db.models.functions.AsWKT\" title=\"django.contrib.gis.db.models.functions.AsWKT\"><code class=\"xref py py-class docutils literal notranslate\">AsWKT</code></a> functions.</p></li>\n<li><p>Added support for PostGIS 3 and GDAL 3.</p></li>\n</ul>\n</section>\n<section id=\"django-contrib-humanize\">\n<h4><a class=\"reference internal\" href=\"/en/dev/ref/contrib/humanize/#module-django.contrib.humanize\" title=\"django.contrib.humanize: A set of Django template filters useful for adding a &quot;human touch&quot; to data.\"><code class=\"xref py py-mod docutils literal notranslate\">django.contrib.humanize</code></a><a class=\"heading-anchor\" href=\"#django-contrib-humanize\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h4>\n<ul class=\"simple\">\n<li><p><a class=\"reference internal\" href=\"/en/dev/ref/contrib/humanize/#std-templatefilter-intword\"><code class=\"xref std std-tfilter docutils literal notranslate\">intword</code></a> template filter now supports negative integers.</p></li>\n</ul>\n</section>\n<section id=\"django-contrib-postgres\">\n<h4><a class=\"reference internal\" href=\"/en/dev/ref/contrib/postgres/#module-django.contrib.postgres\" title=\"django.contrib.postgres: PostgreSQL-specific fields and features\"><code class=\"xref py py-mod docutils literal notranslate\">django.contrib.postgres</code></a><a class=\"heading-anchor\" href=\"#django-contrib-postgres\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h4>\n<ul class=\"simple\">\n<li><p>The new <a class=\"reference internal\" href=\"/en/dev/ref/contrib/postgres/indexes/#django.contrib.postgres.indexes.BloomIndex\" title=\"django.contrib.postgres.indexes.BloomIndex\"><code class=\"xref py py-class docutils literal notranslate\">BloomIndex</code></a> class allows\ncreating <code class=\"docutils literal notranslate\">bloom</code> indexes in the database. The new\n<a class=\"reference internal\" href=\"/en/dev/ref/contrib/postgres/operations/#django.contrib.postgres.operations.BloomExtension\" title=\"django.contrib.postgres.operations.BloomExtension\"><code class=\"xref py py-class docutils literal notranslate\">BloomExtension</code></a> migration\noperation installs the <code class=\"docutils literal notranslate\">bloom</code> extension to add support for this index.</p></li>\n<li><p><a class=\"reference internal\" href=\"/en/dev/ref/models/instances/#django.db.models.Model.get_FOO_display\" title=\"django.db.models.Model.get_FOO_display\"><code class=\"xref py py-meth docutils literal notranslate\">get_FOO_display()</code></a> now supports\n<a class=\"reference internal\" href=\"/en/dev/ref/contrib/postgres/fields/#django.contrib.postgres.fields.ArrayField\" title=\"django.contrib.postgres.fields.ArrayField\"><code class=\"xref py py-class docutils literal notranslate\">ArrayField</code></a> and\n<a class=\"reference internal\" href=\"/en/dev/ref/contrib/postgres/fields/#django.contrib.postgres.fields.RangeField\" title=\"django.contrib.postgres.fields.RangeField\"><code class=\"xref py py-class docutils literal notranslate\">RangeField</code></a>.</p></li>\n<li><p>The new <a class=\"reference internal\" href=\"/en/dev/ref/contrib/postgres/fields/#std-fieldlookup-rangefield.lower_inc\"><code class=\"xref std std-lookup docutils literal notranslate\">rangefield.lower_inc</code></a>, <a class=\"reference internal\" href=\"/en/dev/ref/contrib/postgres/fields/#std-fieldlookup-rangefield.lower_inf\"><code class=\"xref std std-lookup docutils literal notranslate\">rangefield.lower_inf</code></a>,\n<a class=\"reference internal\" href=\"/en/dev/ref/contrib/postgres/fields/#std-fieldlookup-rangefield.upper_inc\"><code class=\"xref std std-lookup docutils literal notranslate\">rangefield.upper_inc</code></a>, and <a class=\"reference internal\" href=\"/en/dev/ref/contrib/postgres/fields/#std-fieldlookup-rangefield.upper_inf\"><code class=\"xref std std-lookup docutils literal notranslate\">rangefield.upper_inf</code></a> lookups\nallow querying <a class=\"reference internal\" href=\"/en/dev/ref/contrib/postgres/fields/#django.contrib.postgres.fields.RangeField\" title=\"django.contrib.postgres.fields.RangeField\"><code class=\"xref py py-class docutils literal notranslate\">RangeField</code></a> by a bound\ntype.</p></li>\n<li><p><a class=\"reference internal\" href=\"/en/dev/ref/contrib/postgres/fields/#std-fieldlookup-rangefield.contained_by\"><code class=\"xref std std-lookup docutils literal notranslate\">rangefield.contained_by</code></a> now supports\n<a class=\"reference internal\" href=\"/en/dev/ref/models/fields/#django.db.models.SmallAutoField\" title=\"django.db.models.SmallAutoField\"><code class=\"xref py py-class docutils literal notranslate\">SmallAutoField</code></a>,\n<a class=\"reference internal\" href=\"/en/dev/ref/models/fields/#django.db.models.AutoField\" title=\"django.db.models.AutoField\"><code class=\"xref py py-class docutils literal notranslate\">AutoField</code></a>,\n<a class=\"reference internal\" href=\"/en/dev/ref/models/fields/#django.db.models.BigAutoField\" title=\"django.db.models.BigAutoField\"><code class=\"xref py py-class docutils literal notranslate\">BigAutoField</code></a>,\n<a class=\"reference internal\" href=\"/en/dev/ref/models/fields/#django.db.models.SmallIntegerField\" title=\"django.db.models.SmallIntegerField\"><code class=\"xref py py-class docutils literal notranslate\">SmallIntegerField</code></a>, and\n<a class=\"reference internal\" href=\"/en/dev/ref/models/fields/#django.db.models.DecimalField\" title=\"django.db.models.DecimalField\"><code class=\"xref py py-class docutils literal notranslate\">DecimalField</code></a>.</p></li>\n<li><p><a class=\"reference internal\" href=\"/en/dev/ref/contrib/postgres/search/#django.contrib.postgres.search.SearchQuery\" title=\"django.contrib.postgres.search.SearchQuery\"><code class=\"xref py py-class docutils literal notranslate\">SearchQuery</code></a> now supports\n<code class=\"docutils literal notranslate\">'websearch'</code> search type on PostgreSQL 11+.</p></li>\n<li><p><a class=\"reference internal\" href=\"/en/dev/ref/contrib/postgres/search/#django.contrib.postgres.search.SearchQuery\" title=\"django.contrib.postgres.search.SearchQuery\"><code class=\"xref py py-class docutils literal notranslate\">SearchQuery.value</code></a> now\nsupports query expressions.</p></li>\n<li><p>The new <a class=\"reference internal\" href=\"/en/dev/ref/contrib/postgres/search/#django.contrib.postgres.search.SearchHeadline\" title=\"django.contrib.postgres.search.SearchHeadline\"><code class=\"xref py py-class docutils literal notranslate\">SearchHeadline</code></a> class allows\nhighlighting search results.</p></li>\n<li><p><a class=\"reference internal\" href=\"/en/dev/ref/contrib/postgres/search/#std-fieldlookup-search\"><code class=\"xref std std-lookup docutils literal notranslate\">search</code></a> lookup now supports query expressions.</p></li>\n<li><p>The new <code class=\"docutils literal notranslate\">cover_density</code> parameter of\n<a class=\"reference internal\" href=\"/en/dev/ref/contrib/postgres/search/#django.contrib.postgres.search.SearchRank\" title=\"django.contrib.postgres.search.SearchRank\"><code class=\"xref py py-class docutils literal notranslate\">SearchRank</code></a> allows ranking by cover\ndensity.</p></li>\n<li><p>The new <code class=\"docutils literal notranslate\">normalization</code> parameter of\n<a class=\"reference internal\" href=\"/en/dev/ref/contrib/postgres/search/#django.contrib.postgres.search.SearchRank\" title=\"django.contrib.postgres.search.SearchRank\"><code class=\"xref py py-class docutils literal notranslate\">SearchRank</code></a> allows rank\nnormalization.</p></li>\n<li><p>The new <a class=\"reference internal\" href=\"/en/dev/ref/contrib/postgres/constraints/#django.contrib.postgres.constraints.ExclusionConstraint.deferrable\" title=\"django.contrib.postgres.constraints.ExclusionConstraint.deferrable\"><code class=\"xref py py-attr docutils literal notranslate\">ExclusionConstraint.deferrable</code></a> attribute allows creating\ndeferrable exclusion constraints.</p></li>\n</ul>\n</section>\n<section id=\"django-contrib-sessions\">\n<h4><a class=\"reference internal\" href=\"/en/dev/topics/http/sessions/#module-django.contrib.sessions\" title=\"django.contrib.sessions: Provides session management for Django projects.\"><code class=\"xref py py-mod docutils literal notranslate\">django.contrib.sessions</code></a><a class=\"heading-anchor\" href=\"#django-contrib-sessions\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h4>\n<ul class=\"simple\">\n<li><p>The <a class=\"reference internal\" href=\"/en/dev/ref/settings/#std-setting-SESSION_COOKIE_SAMESITE\"><code class=\"xref std std-setting docutils literal notranslate\">SESSION_COOKIE_SAMESITE</code></a> setting now allows <code class=\"docutils literal notranslate\">'None'</code> (string)\nvalue to explicitly state that the cookie is sent with all same-site and\ncross-site requests.</p></li>\n</ul>\n</section>\n<section id=\"django-contrib-staticfiles\">\n<h4><a class=\"reference internal\" href=\"/en/dev/ref/contrib/staticfiles/#module-django.contrib.staticfiles\" title=\"django.contrib.staticfiles: An app for handling static files.\"><code class=\"xref py py-mod docutils literal notranslate\">django.contrib.staticfiles</code></a><a class=\"heading-anchor\" href=\"#django-contrib-staticfiles\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h4>\n<ul class=\"simple\">\n<li><p>The <a class=\"reference internal\" href=\"/en/dev/ref/settings/#std-setting-STATICFILES_DIRS\"><code class=\"xref std std-setting docutils literal notranslate\">STATICFILES_DIRS</code></a> setting now supports <a class=\"reference external\" href=\"https://docs.python.org/3/library/pathlib.html#pathlib.Path\" title=\"(in Python v3.14)\"><code class=\"xref py py-class docutils literal notranslate\">pathlib.Path</code></a>.</p></li>\n</ul>\n</section>\n<section id=\"cache\">\n<h4>Cache<a class=\"heading-anchor\" href=\"#cache\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h4>\n<ul class=\"simple\">\n<li><p>The <a class=\"reference internal\" href=\"/en/dev/topics/http/decorators/#django.views.decorators.cache.cache_control\" title=\"django.views.decorators.cache.cache_control\"><code class=\"xref py py-func docutils literal notranslate\">cache_control()</code></a> decorator and\n<a class=\"reference internal\" href=\"/en/dev/ref/utils/#django.utils.cache.patch_cache_control\" title=\"django.utils.cache.patch_cache_control\"><code class=\"xref py py-func docutils literal notranslate\">patch_cache_control()</code></a> method now support multiple\nfield names in the <code class=\"docutils literal notranslate\">no-cache</code> directive for the <code class=\"docutils literal notranslate\">Cache-Control</code> header,\naccording to <span class=\"target\" id=\"index-0\"></span><a class=\"rfc reference external\" href=\"https://datatracker.ietf.org/doc/html/rfc7234.html#section-5.2.2.2\"><strong>RFC 7234 Section 5.2.2.2</strong></a>.</p></li>\n<li><p><a class=\"reference internal\" href=\"/en/dev/topics/cache/#django.core.cache.cache.delete\" title=\"django.core.cache.cache.delete\"><code class=\"xref py py-meth docutils literal notranslate\">delete()</code></a> now returns <code class=\"docutils literal notranslate\">True</code> if the key was\nsuccessfully deleted, <code class=\"docutils literal notranslate\">False</code> otherwise.</p></li>\n</ul>\n</section>\n<section id=\"csrf\">\n<h4>CSRF<a class=\"heading-anchor\" href=\"#csrf\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h4>\n<ul class=\"simple\">\n<li><p>The <a class=\"reference internal\" href=\"/en/dev/ref/settings/#std-setting-CSRF_COOKIE_SAMESITE\"><code class=\"xref std std-setting docutils literal notranslate\">CSRF_COOKIE_SAMESITE</code></a> setting now allows <code class=\"docutils literal notranslate\">'None'</code> (string)\nvalue to explicitly state that the cookie is sent with all same-site and\ncross-site requests.</p></li>\n</ul>\n</section>\n<section id=\"email\">\n<h4>Email<a class=\"heading-anchor\" href=\"#email\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h4>\n<ul class=\"simple\">\n<li><p>The <a class=\"reference internal\" href=\"/en/dev/ref/settings/#std-setting-EMAIL_FILE_PATH\"><code class=\"xref std std-setting docutils literal notranslate\">EMAIL_FILE_PATH</code></a> setting, used by the <a class=\"reference internal\" href=\"/en/dev/topics/email/#topic-email-file-backend\"><span class=\"std std-ref\">file email backend</span></a>, now supports <a class=\"reference external\" href=\"https://docs.python.org/3/library/pathlib.html#pathlib.Path\" title=\"(in Python v3.14)\"><code class=\"xref py py-class docutils literal notranslate\">pathlib.Path</code></a>.</p></li>\n</ul>\n</section>\n<section id=\"error-reporting\">\n<h4>Error Reporting<a class=\"heading-anchor\" href=\"#error-reporting\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h4>\n<ul class=\"simple\">\n<li><p><a class=\"reference internal\" href=\"/en/dev/howto/error-reporting/#django.views.debug.SafeExceptionReporterFilter\" title=\"django.views.debug.SafeExceptionReporterFilter\"><code class=\"xref py py-class docutils literal notranslate\">django.views.debug.SafeExceptionReporterFilter</code></a> now filters sensitive\nvalues from <code class=\"docutils literal notranslate\">request.META</code> in exception reports.</p></li>\n<li><p>The new <a class=\"reference internal\" href=\"/en/dev/howto/error-reporting/#django.views.debug.SafeExceptionReporterFilter.cleansed_substitute\" title=\"django.views.debug.SafeExceptionReporterFilter.cleansed_substitute\"><code class=\"xref py py-attr docutils literal notranslate\">SafeExceptionReporterFilter.cleansed_substitute</code></a> and\n<a class=\"reference internal\" href=\"/en/dev/howto/error-reporting/#django.views.debug.SafeExceptionReporterFilter.hidden_settings\" title=\"django.views.debug.SafeExceptionReporterFilter.hidden_settings\"><code class=\"xref py py-attr docutils literal notranslate\">SafeExceptionReporterFilter.hidden_settings</code></a> attributes allow\ncustomization of sensitive settings and <code class=\"docutils literal notranslate\">request.META</code> filtering in\nexception reports.</p></li>\n<li><p>The technical 404 debug view now respects\n<a class=\"reference internal\" href=\"/en/dev/ref/settings/#std-setting-DEFAULT_EXCEPTION_REPORTER_FILTER\"><code class=\"xref std std-setting docutils literal notranslate\">DEFAULT_EXCEPTION_REPORTER_FILTER</code></a> when applying settings\nfiltering.</p></li>\n<li><p>The new <a class=\"reference internal\" href=\"/en/dev/ref/settings/#std-setting-DEFAULT_EXCEPTION_REPORTER\"><code class=\"xref std std-setting docutils literal notranslate\">DEFAULT_EXCEPTION_REPORTER</code></a> allows providing a\n<a class=\"reference internal\" href=\"/en/dev/howto/error-reporting/#django.views.debug.ExceptionReporter\" title=\"django.views.debug.ExceptionReporter\"><code class=\"xref py py-class docutils literal notranslate\">django.views.debug.ExceptionReporter</code></a> subclass to customize exception\nreport generation. See <a class=\"reference internal\" href=\"/en/dev/howto/error-reporting/#custom-error-reports\"><span class=\"std std-ref\">Custom error reports</span></a> for details.</p></li>\n</ul>\n</section>\n<section id=\"file-storage\">\n<h4>File Storage<a class=\"heading-anchor\" href=\"#file-storage\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h4>\n<ul class=\"simple\">\n<li><p><code class=\"docutils literal notranslate\">FileSystemStorage.save()</code> method now supports <a class=\"reference external\" href=\"https://docs.python.org/3/library/pathlib.html#pathlib.Path\" title=\"(in Python v3.14)\"><code class=\"xref py py-class docutils literal notranslate\">pathlib.Path</code></a>.</p></li>\n<li><p><a class=\"reference internal\" href=\"/en/dev/ref/models/fields/#django.db.models.FileField\" title=\"django.db.models.FileField\"><code class=\"xref py py-class docutils literal notranslate\">FileField</code></a> and\n<a class=\"reference internal\" href=\"/en/dev/ref/models/fields/#django.db.models.ImageField\" title=\"django.db.models.ImageField\"><code class=\"xref py py-class docutils literal notranslate\">ImageField</code></a> now accept a callable for <code class=\"docutils literal notranslate\">storage</code>.\nThis allows you to modify the used storage at runtime, selecting different\nstorages for different environments, for example.</p></li>\n</ul>\n</section>\n<section id=\"forms\">\n<h4>Forms<a class=\"heading-anchor\" href=\"#forms\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h4>\n<ul>\n<li><p><a class=\"reference internal\" href=\"/en/dev/ref/forms/fields/#django.forms.ModelChoiceIterator\" title=\"django.forms.ModelChoiceIterator\"><code class=\"xref py py-class docutils literal notranslate\">ModelChoiceIterator</code></a>, used by\n<a class=\"reference internal\" href=\"/en/dev/ref/forms/fields/#django.forms.ModelChoiceField\" title=\"django.forms.ModelChoiceField\"><code class=\"xref py py-class docutils literal notranslate\">ModelChoiceField</code></a> and\n<a class=\"reference internal\" href=\"/en/dev/ref/forms/fields/#django.forms.ModelMultipleChoiceField\" title=\"django.forms.ModelMultipleChoiceField\"><code class=\"xref py py-class docutils literal notranslate\">ModelMultipleChoiceField</code></a>, now uses\n<a class=\"reference internal\" href=\"/en/dev/ref/forms/fields/#django.forms.ModelChoiceIteratorValue\" title=\"django.forms.ModelChoiceIteratorValue\"><code class=\"xref py py-class docutils literal notranslate\">ModelChoiceIteratorValue</code></a> that can be used by widgets\nto access model instances. See <a class=\"reference internal\" href=\"/en/dev/ref/forms/fields/#iterating-relationship-choices\"><span class=\"std std-ref\">Iterating relationship choices</span></a> for\ndetails.</p></li>\n<li><p><a class=\"reference internal\" href=\"/en/dev/ref/forms/fields/#django.forms.DateTimeField\" title=\"django.forms.DateTimeField\"><code class=\"xref py py-class docutils literal notranslate\">django.forms.DateTimeField</code></a> now accepts dates in a subset of ISO 8601\ndatetime formats, including optional timezone, e.g. <code class=\"docutils literal notranslate\">2019-10-10T06:47</code>,\n<code class=\"docutils literal notranslate\">2019-10-10T06:47:23+04:00</code>, or <code class=\"docutils literal notranslate\">2019-10-10T06:47:23Z</code>. The timezone will\nalways be retained if provided, with timezone-aware datetimes being returned\neven when <a class=\"reference internal\" href=\"/en/dev/ref/settings/#std-setting-USE_TZ\"><code class=\"xref std std-setting docutils literal notranslate\">USE_TZ</code></a> is <code class=\"docutils literal notranslate\">False</code>.</p>\n<p>Additionally, <code class=\"docutils literal notranslate\">DateTimeField</code> now uses <code class=\"docutils literal notranslate\">DATE_INPUT_FORMATS</code> in addition\nto <code class=\"docutils literal notranslate\">DATETIME_INPUT_FORMATS</code> when converting a field input to a <code class=\"docutils literal notranslate\">datetime</code>\nvalue.</p>\n</li>\n<li><p><a class=\"reference internal\" href=\"/en/dev/ref/forms/widgets/#django.forms.MultiWidget.widgets\" title=\"django.forms.MultiWidget.widgets\"><code class=\"xref py py-attr docutils literal notranslate\">MultiWidget.widgets</code></a> now accepts a dictionary which allows\ncustomizing subwidget <code class=\"docutils literal notranslate\">name</code> attributes.</p></li>\n<li><p>The new <a class=\"reference internal\" href=\"/en/dev/ref/forms/api/#django.forms.BoundField.widget_type\" title=\"django.forms.BoundField.widget_type\"><code class=\"xref py py-attr docutils literal notranslate\">BoundField.widget_type</code></a> property can be used to dynamically\nadjust form rendering based upon the widget type.</p></li>\n</ul>\n</section>\n<section id=\"internationalization\">\n<h4>Internationalization<a class=\"heading-anchor\" href=\"#internationalization\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h4>\n<ul class=\"simple\">\n<li><p>The <a class=\"reference internal\" href=\"/en/dev/ref/settings/#std-setting-LANGUAGE_COOKIE_SAMESITE\"><code class=\"xref std std-setting docutils literal notranslate\">LANGUAGE_COOKIE_SAMESITE</code></a> setting now allows <code class=\"docutils literal notranslate\">'None'</code>\n(string) value to explicitly state that the cookie is sent with all same-site\nand cross-site requests.</p></li>\n<li><p>Added support and translations for the Algerian Arabic, Igbo, Kyrgyz, Tajik,\nand Turkmen languages.</p></li>\n</ul>\n</section>\n<section id=\"management-commands\">\n<h4>Management Commands<a class=\"heading-anchor\" href=\"#management-commands\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h4>\n<ul class=\"simple\">\n<li><p>The new <a class=\"reference internal\" href=\"/en/dev/ref/django-admin/#cmdoption-check-database\"><code class=\"xref std std-option docutils literal notranslate\">check --database</code></a> option allows specifying database aliases\nfor running the <code class=\"docutils literal notranslate\">database</code> system checks. Previously these checks were\nenabled for all configured <a class=\"reference internal\" href=\"/en/dev/ref/settings/#std-setting-DATABASES\"><code class=\"xref std std-setting docutils literal notranslate\">DATABASES</code></a> by passing the <code class=\"docutils literal notranslate\">database</code>\ntag to the command.</p></li>\n<li><p>The new <a class=\"reference internal\" href=\"/en/dev/ref/django-admin/#cmdoption-migrate-check\"><code class=\"xref std std-option docutils literal notranslate\">migrate --check</code></a> option makes the command exit with a\nnon-zero status when unapplied migrations are detected.</p></li>\n<li><p>The new <code class=\"docutils literal notranslate\">returncode</code> argument for\n<a class=\"reference internal\" href=\"/en/dev/howto/custom-management-commands/#django.core.management.CommandError\" title=\"django.core.management.CommandError\"><code class=\"xref py py-attr docutils literal notranslate\">CommandError</code></a> allows customizing the exit\nstatus for management commands.</p></li>\n<li><p>The new <a class=\"reference internal\" href=\"/en/dev/ref/django-admin/#cmdoption-dbshell-0\"><code class=\"xref std std-option docutils literal notranslate\">dbshell -- ARGUMENTS</code></a> option allows passing\nextra arguments to the command-line client for the database.</p></li>\n<li><p>The <a class=\"reference internal\" href=\"/en/dev/ref/django-admin/#django-admin-flush\"><code class=\"xref std std-djadmin docutils literal notranslate\">flush</code></a> and <a class=\"reference internal\" href=\"/en/dev/ref/django-admin/#django-admin-sqlflush\"><code class=\"xref std std-djadmin docutils literal notranslate\">sqlflush</code></a> commands now include SQL to\nreset sequences on SQLite.</p></li>\n</ul>\n</section>\n<section id=\"models\">\n<h4>Models<a class=\"heading-anchor\" href=\"#models\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h4>\n<ul class=\"simple\">\n<li><p>The new <a class=\"reference internal\" href=\"/en/dev/ref/models/database-functions/#django.db.models.functions.ExtractIsoWeekDay\" title=\"django.db.models.functions.ExtractIsoWeekDay\"><code class=\"xref py py-class docutils literal notranslate\">ExtractIsoWeekDay</code></a> function\nextracts ISO-8601 week days from <a class=\"reference internal\" href=\"/en/dev/ref/models/fields/#django.db.models.DateField\" title=\"django.db.models.DateField\"><code class=\"xref py py-class docutils literal notranslate\">DateField</code></a> and\n<a class=\"reference internal\" href=\"/en/dev/ref/models/fields/#django.db.models.DateTimeField\" title=\"django.db.models.DateTimeField\"><code class=\"xref py py-class docutils literal notranslate\">DateTimeField</code></a>, and the new <a class=\"reference internal\" href=\"/en/dev/ref/models/querysets/#std-fieldlookup-iso_week_day\"><code class=\"xref std std-lookup docutils literal notranslate\">iso_week_day</code></a>\nlookup allows querying by an ISO-8601 day of week.</p></li>\n<li><p><a class=\"reference internal\" href=\"/en/dev/ref/models/querysets/#django.db.models.query.QuerySet.explain\" title=\"django.db.models.query.QuerySet.explain\"><code class=\"xref py py-meth docutils literal notranslate\">QuerySet.explain()</code></a> now supports:</p>\n<ul>\n<li><p><code class=\"docutils literal notranslate\">TREE</code> format on MySQL 8.0.16+,</p></li>\n<li><p><code class=\"docutils literal notranslate\">analyze</code> option on MySQL 8.0.18+ and MariaDB.</p></li>\n</ul>\n</li>\n<li><p>Added <a class=\"reference internal\" href=\"/en/dev/ref/models/fields/#django.db.models.PositiveBigIntegerField\" title=\"django.db.models.PositiveBigIntegerField\"><code class=\"xref py py-class docutils literal notranslate\">PositiveBigIntegerField</code></a> which acts much like\na <a class=\"reference internal\" href=\"/en/dev/ref/models/fields/#django.db.models.PositiveIntegerField\" title=\"django.db.models.PositiveIntegerField\"><code class=\"xref py py-class docutils literal notranslate\">PositiveIntegerField</code></a> except that it only allows\nvalues under a certain (database-dependent) limit. Values from <code class=\"docutils literal notranslate\">0</code> to\n<code class=\"docutils literal notranslate\">9223372036854775807</code> are safe in all databases supported by Django.</p></li>\n<li><p>The new <a class=\"reference internal\" href=\"/en/dev/ref/models/fields/#django.db.models.RESTRICT\" title=\"django.db.models.RESTRICT\"><code class=\"xref py py-class docutils literal notranslate\">RESTRICT</code></a> option for\n<a class=\"reference internal\" href=\"/en/dev/ref/models/fields/#django.db.models.ForeignKey.on_delete\" title=\"django.db.models.ForeignKey.on_delete\"><code class=\"xref py py-attr docutils literal notranslate\">on_delete</code></a> argument of <code class=\"docutils literal notranslate\">ForeignKey</code> and\n<code class=\"docutils literal notranslate\">OneToOneField</code> emulates the behavior of the SQL constraint <code class=\"docutils literal notranslate\">ON DELETE\nRESTRICT</code>.</p></li>\n<li><p><code class=\"docutils literal notranslate\">CheckConstraint.check</code> now supports boolean expressions.</p></li>\n<li><p>The <a class=\"reference internal\" href=\"/en/dev/ref/models/relations/#django.db.models.fields.related.RelatedManager.add\" title=\"django.db.models.fields.related.RelatedManager.add\"><code class=\"xref py py-meth docutils literal notranslate\">RelatedManager.add()</code></a>, <a class=\"reference internal\" href=\"/en/dev/ref/models/relations/#django.db.models.fields.related.RelatedManager.create\" title=\"django.db.models.fields.related.RelatedManager.create\"><code class=\"xref py py-meth docutils literal notranslate\">create()</code></a>, and\n<a class=\"reference internal\" href=\"/en/dev/ref/models/relations/#django.db.models.fields.related.RelatedManager.set\" title=\"django.db.models.fields.related.RelatedManager.set\"><code class=\"xref py py-meth docutils literal notranslate\">set()</code></a> methods now accept callables as values in the\n<code class=\"docutils literal notranslate\">through_defaults</code> argument.</p></li>\n<li><p>The new <code class=\"docutils literal notranslate\">is_dst</code>  parameter of the <a class=\"reference internal\" href=\"/en/dev/ref/models/querysets/#django.db.models.query.QuerySet.datetimes\" title=\"django.db.models.query.QuerySet.datetimes\"><code class=\"xref py py-meth docutils literal notranslate\">QuerySet.datetimes()</code></a> determines\nthe treatment of nonexistent and ambiguous datetimes.</p></li>\n<li><p>The new <a class=\"reference internal\" href=\"/en/dev/ref/models/expressions/#django.db.models.F\" title=\"django.db.models.F\"><code class=\"xref py py-class docutils literal notranslate\">F</code></a> expression <code class=\"docutils literal notranslate\">bitxor()</code> method allows\n<a class=\"reference internal\" href=\"/en/dev/topics/db/queries/#using-f-expressions-in-filters\"><span class=\"std std-ref\">bitwise XOR operation</span></a>.</p></li>\n<li><p><a class=\"reference internal\" href=\"/en/dev/ref/models/querysets/#django.db.models.query.QuerySet.bulk_create\" title=\"django.db.models.query.QuerySet.bulk_create\"><code class=\"xref py py-meth docutils literal notranslate\">QuerySet.bulk_create()</code></a> now sets the primary key on objects when using\nMariaDB 10.5+.</p></li>\n<li><p>The <code class=\"docutils literal notranslate\">DatabaseOperations.sql_flush()</code> method now generates more efficient\nSQL on MySQL by using <code class=\"docutils literal notranslate\">DELETE</code> instead of <code class=\"docutils literal notranslate\">TRUNCATE</code> statements for\ntables which don’t require resetting sequences.</p></li>\n<li><p>SQLite functions are now marked as <a class=\"reference external\" href=\"https://docs.python.org/3/library/sqlite3.html#sqlite3.Connection.create_function\" title=\"(in Python v3.14)\"><code class=\"xref py py-meth docutils literal notranslate\">deterministic</code></a> on Python 3.8+. This allows using them\nin check constraints and partial indexes.</p></li>\n<li><p>The new <a class=\"reference internal\" href=\"/en/dev/ref/models/constraints/#django.db.models.UniqueConstraint.deferrable\" title=\"django.db.models.UniqueConstraint.deferrable\"><code class=\"xref py py-attr docutils literal notranslate\">UniqueConstraint.deferrable</code></a> attribute allows creating\ndeferrable unique constraints.</p></li>\n</ul>\n</section>\n<section id=\"pagination\">\n<h4>Pagination<a class=\"heading-anchor\" href=\"#pagination\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h4>\n<ul class=\"simple\">\n<li><p><a class=\"reference internal\" href=\"/en/dev/ref/paginator/#django.core.paginator.Paginator\" title=\"django.core.paginator.Paginator\"><code class=\"xref py py-class docutils literal notranslate\">Paginator</code></a> can now be iterated over to yield\nits pages.</p></li>\n</ul>\n</section>\n<section id=\"requests-and-responses\">\n<h4>Requests and Responses<a class=\"heading-anchor\" href=\"#requests-and-responses\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h4>\n<ul class=\"simple\">\n<li><p>If <a class=\"reference internal\" href=\"/en/dev/ref/settings/#std-setting-ALLOWED_HOSTS\"><code class=\"xref std std-setting docutils literal notranslate\">ALLOWED_HOSTS</code></a> is empty and <code class=\"docutils literal notranslate\">DEBUG=True</code>, subdomains of\nlocalhost are now allowed in the <code class=\"docutils literal notranslate\">Host</code> header, e.g. <code class=\"docutils literal notranslate\">static.localhost</code>.</p></li>\n<li><p><a class=\"reference internal\" href=\"/en/dev/ref/request-response/#django.http.HttpResponse.set_cookie\" title=\"django.http.HttpResponse.set_cookie\"><code class=\"xref py py-meth docutils literal notranslate\">HttpResponse.set_cookie()</code></a> and <a class=\"reference internal\" href=\"/en/dev/ref/request-response/#django.http.HttpResponse.set_signed_cookie\" title=\"django.http.HttpResponse.set_signed_cookie\"><code class=\"xref py py-meth docutils literal notranslate\">HttpResponse.set_signed_cookie()</code></a>\nnow allow using <code class=\"docutils literal notranslate\">samesite='None'</code> (string) to explicitly state that the\ncookie is sent with all same-site and cross-site requests.</p></li>\n<li><p>The new <a class=\"reference internal\" href=\"/en/dev/ref/request-response/#django.http.HttpRequest.accepts\" title=\"django.http.HttpRequest.accepts\"><code class=\"xref py py-meth docutils literal notranslate\">HttpRequest.accepts()</code></a> method returns whether the request\naccepts the given MIME type according to the <code class=\"docutils literal notranslate\">Accept</code> HTTP header.</p></li>\n</ul>\n</section>\n<section id=\"security\">\n<span id=\"whats-new-security-3-1\"></span><h4>Security<a class=\"heading-anchor\" href=\"#security\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h4>\n<ul>\n<li><p>The <a class=\"reference internal\" href=\"/en/dev/ref/settings/#std-setting-SECURE_REFERRER_POLICY\"><code class=\"xref std std-setting docutils literal notranslate\">SECURE_REFERRER_POLICY</code></a> setting now defaults to\n<code class=\"docutils literal notranslate\">'same-origin'</code>. With this configured,\n<a class=\"reference internal\" href=\"/en/dev/ref/middleware/#django.middleware.security.SecurityMiddleware\" title=\"django.middleware.security.SecurityMiddleware\"><code class=\"xref py py-class docutils literal notranslate\">SecurityMiddleware</code></a> sets the\n<a class=\"reference internal\" href=\"/en/dev/ref/middleware/#referrer-policy\"><span class=\"std std-ref\">Referrer Policy</span></a> header to <code class=\"docutils literal notranslate\">same-origin</code> on all responses that do not\nalready have it. This prevents the <code class=\"docutils literal notranslate\">Referer</code> header being sent to other\norigins. If you need the previous behavior, explicitly set\n<a class=\"reference internal\" href=\"/en/dev/ref/settings/#std-setting-SECURE_REFERRER_POLICY\"><code class=\"xref std std-setting docutils literal notranslate\">SECURE_REFERRER_POLICY</code></a> to <code class=\"docutils literal notranslate\">None</code>.</p></li>\n<li><p>The default algorithm of <a class=\"reference internal\" href=\"/en/dev/topics/signing/#django.core.signing.Signer\" title=\"django.core.signing.Signer\"><code class=\"xref py py-class docutils literal notranslate\">django.core.signing.Signer</code></a>,\n<a class=\"reference internal\" href=\"/en/dev/topics/signing/#django.core.signing.loads\" title=\"django.core.signing.loads\"><code class=\"xref py py-meth docutils literal notranslate\">django.core.signing.loads()</code></a>, and <a class=\"reference internal\" href=\"/en/dev/topics/signing/#django.core.signing.dumps\" title=\"django.core.signing.dumps\"><code class=\"xref py py-meth docutils literal notranslate\">django.core.signing.dumps()</code></a> is\nchanged to the SHA-256. Support for signatures made with the old SHA-1\nalgorithm remains until Django 4.0.</p>\n<p>Also, the new <code class=\"docutils literal notranslate\">algorithm</code> parameter of the\n<a class=\"reference internal\" href=\"/en/dev/topics/signing/#django.core.signing.Signer\" title=\"django.core.signing.Signer\"><code class=\"xref py py-class docutils literal notranslate\">Signer</code></a> allows customizing the hashing\nalgorithm.</p>\n</li>\n</ul>\n</section>\n<section id=\"templates\">\n<h4>Templates<a class=\"heading-anchor\" href=\"#templates\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h4>\n<ul class=\"simple\">\n<li><p>The renamed <a class=\"reference internal\" href=\"/en/dev/topics/i18n/translation/#std-templatetag-translate\"><code class=\"xref std std-ttag docutils literal notranslate\">translate</code></a> and <a class=\"reference internal\" href=\"/en/dev/topics/i18n/translation/#std-templatetag-blocktranslate\"><code class=\"xref std std-ttag docutils literal notranslate\">blocktranslate</code></a> template tags are\nintroduced for internationalization in template code. The older <a class=\"reference internal\" href=\"/en/dev/topics/i18n/translation/#std-templatetag-trans\"><code class=\"xref std std-ttag docutils literal notranslate\">trans</code></a>\nand <a class=\"reference internal\" href=\"/en/dev/topics/i18n/translation/#std-templatetag-blocktrans\"><code class=\"xref std std-ttag docutils literal notranslate\">blocktrans</code></a> template tags aliases continue to work, and will be\nretained for the foreseeable future.</p></li>\n<li><p>The <a class=\"reference internal\" href=\"/en/dev/ref/templates/builtins/#std-templatetag-include\"><code class=\"xref std std-ttag docutils literal notranslate\">include</code></a> template tag now accepts iterables of template names.</p></li>\n</ul>\n</section>\n<section id=\"tests\">\n<h4>Tests<a class=\"heading-anchor\" href=\"#tests\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h4>\n<ul class=\"simple\">\n<li><p><a class=\"reference internal\" href=\"/en/dev/topics/testing/tools/#django.test.SimpleTestCase\" title=\"django.test.SimpleTestCase\"><code class=\"xref py py-class docutils literal notranslate\">SimpleTestCase</code></a> now implements the <code class=\"docutils literal notranslate\">debug()</code> method to\nallow running a test without collecting the result and catching exceptions.\nThis can be used to support running tests under a debugger.</p></li>\n<li><p>The new <a class=\"reference internal\" href=\"/en/dev/ref/settings/#std-setting-TEST_MIGRATE\"><code class=\"xref std std-setting docutils literal notranslate\">MIGRATE</code></a> test database setting allows\ndisabling of migrations during a test database creation.</p></li>\n<li><p><a class=\"reference internal\" href=\"/en/dev/topics/testing/advanced/#django.test.runner.DiscoverRunner\" title=\"django.test.runner.DiscoverRunner\"><code class=\"xref py py-class docutils literal notranslate\">DiscoverRunner</code></a> can now discard output for\npassing tests using the <a class=\"reference internal\" href=\"/en/dev/ref/django-admin/#cmdoption-test-buffer\"><code class=\"xref std std-option docutils literal notranslate\">test --buffer</code></a> option.</p></li>\n<li><p><a class=\"reference internal\" href=\"/en/dev/topics/testing/advanced/#django.test.runner.DiscoverRunner\" title=\"django.test.runner.DiscoverRunner\"><code class=\"xref py py-class docutils literal notranslate\">DiscoverRunner</code></a> now skips running the system\nchecks on databases not <a class=\"reference internal\" href=\"/en/dev/topics/testing/tools/#testing-multi-db\"><span class=\"std std-ref\">referenced by tests</span></a>.</p></li>\n<li><p><a class=\"reference internal\" href=\"/en/dev/topics/testing/tools/#django.test.TransactionTestCase\" title=\"django.test.TransactionTestCase\"><code class=\"xref py py-class docutils literal notranslate\">TransactionTestCase</code></a> teardown is now faster on MySQL\ndue to <a class=\"reference internal\" href=\"/en/dev/ref/django-admin/#django-admin-flush\"><code class=\"xref std std-djadmin docutils literal notranslate\">flush</code></a> command improvements. As a side effect the latter\ndoesn’t automatically reset sequences on teardown anymore. Enable\n<a class=\"reference internal\" href=\"/en/dev/topics/testing/advanced/#django.test.TransactionTestCase.reset_sequences\" title=\"django.test.TransactionTestCase.reset_sequences\"><code class=\"xref py py-attr docutils literal notranslate\">TransactionTestCase.reset_sequences</code></a> if your tests require this\nfeature.</p></li>\n</ul>\n</section>\n<section id=\"urls\">\n<h4>URLs<a class=\"heading-anchor\" href=\"#urls\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h4>\n<ul class=\"simple\">\n<li><p><a class=\"reference internal\" href=\"/en/dev/topics/http/urls/#registering-custom-path-converters\"><span class=\"std std-ref\">Path converters</span></a> can now raise\n<code class=\"docutils literal notranslate\">ValueError</code> in <code class=\"docutils literal notranslate\">to_url()</code> to indicate no match when reversing URLs.</p></li>\n</ul>\n</section>\n<section id=\"utilities\">\n<h4>Utilities<a class=\"heading-anchor\" href=\"#utilities\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h4>\n<ul class=\"simple\">\n<li><p><a class=\"reference internal\" href=\"/en/dev/ref/utils/#django.utils.encoding.filepath_to_uri\" title=\"django.utils.encoding.filepath_to_uri\"><code class=\"xref py py-func docutils literal notranslate\">filepath_to_uri()</code></a> now supports\n<a class=\"reference external\" href=\"https://docs.python.org/3/library/pathlib.html#pathlib.Path\" title=\"(in Python v3.14)\"><code class=\"xref py py-class docutils literal notranslate\">pathlib.Path</code></a>.</p></li>\n<li><p><a class=\"reference internal\" href=\"/en/dev/ref/utils/#django.utils.dateparse.parse_duration\" title=\"django.utils.dateparse.parse_duration\"><code class=\"xref py py-func docutils literal notranslate\">parse_duration()</code></a> now supports comma separators\nfor decimal fractions in the ISO 8601 format.</p></li>\n<li><p><a class=\"reference internal\" href=\"/en/dev/ref/utils/#django.utils.dateparse.parse_datetime\" title=\"django.utils.dateparse.parse_datetime\"><code class=\"xref py py-func docutils literal notranslate\">parse_datetime()</code></a>,\n<a class=\"reference internal\" href=\"/en/dev/ref/utils/#django.utils.dateparse.parse_duration\" title=\"django.utils.dateparse.parse_duration\"><code class=\"xref py py-func docutils literal notranslate\">parse_duration()</code></a>, and\n<a class=\"reference internal\" href=\"/en/dev/ref/utils/#django.utils.dateparse.parse_time\" title=\"django.utils.dateparse.parse_time\"><code class=\"xref py py-func docutils literal notranslate\">parse_time()</code></a> now support comma separators for\nmilliseconds.</p></li>\n</ul>\n</section>\n<section id=\"miscellaneous\">\n<h4>Miscellaneous<a class=\"heading-anchor\" href=\"#miscellaneous\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h4>\n<ul class=\"simple\">\n<li><p>The SQLite backend now supports <a class=\"reference external\" href=\"https://docs.python.org/3/library/pathlib.html#pathlib.Path\" title=\"(in Python v3.14)\"><code class=\"xref py py-class docutils literal notranslate\">pathlib.Path</code></a> for the <code class=\"docutils literal notranslate\">NAME</code>\nsetting.</p></li>\n<li><p>The <code class=\"docutils literal notranslate\">settings.py</code> generated by the <a class=\"reference internal\" href=\"/en/dev/ref/django-admin/#django-admin-startproject\"><code class=\"xref std std-djadmin docutils literal notranslate\">startproject</code></a> command now uses\n<a class=\"reference external\" href=\"https://docs.python.org/3/library/pathlib.html#pathlib.Path\" title=\"(in Python v3.14)\"><code class=\"xref py py-class docutils literal notranslate\">pathlib.Path</code></a> instead of <a class=\"reference external\" href=\"https://docs.python.org/3/library/os.path.html#module-os.path\" title=\"(in Python v3.14)\"><code class=\"xref py py-mod docutils literal notranslate\">os.path</code></a> for building filesystem\npaths.</p></li>\n<li><p>The <a class=\"reference internal\" href=\"/en/dev/ref/settings/#std-setting-DATABASE-TIME_ZONE\"><code class=\"xref std std-setting docutils literal notranslate\">TIME_ZONE</code></a> setting is now allowed on\ndatabases that support time zones.</p></li>\n</ul>\n</section>\n</section>\n</section>\n<section id=\"backwards-incompatible-changes-in-3-1\">\n<span id=\"backwards-incompatible-3-1\"></span><h2>Backwards incompatible changes in 3.1<a class=\"heading-anchor\" href=\"#backwards-incompatible-changes-in-3-1\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h2>\n<section id=\"database-backend-api\">\n<h3>Database backend API<a class=\"heading-anchor\" href=\"#database-backend-api\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h3>\n<p>This section describes changes that may be needed in third-party database\nbackends.</p>\n<ul class=\"simple\">\n<li><p><code class=\"docutils literal notranslate\">DatabaseOperations.fetch_returned_insert_columns()</code> now requires an\nadditional <code class=\"docutils literal notranslate\">returning_params</code> argument.</p></li>\n<li><p><code class=\"docutils literal notranslate\">connection.timezone</code> property is now <code class=\"docutils literal notranslate\">'UTC'</code> by default, or the\n<a class=\"reference internal\" href=\"/en/dev/ref/settings/#std-setting-DATABASE-TIME_ZONE\"><code class=\"xref std std-setting docutils literal notranslate\">TIME_ZONE</code></a> when <a class=\"reference internal\" href=\"/en/dev/ref/settings/#std-setting-USE_TZ\"><code class=\"xref std std-setting docutils literal notranslate\">USE_TZ</code></a> is <code class=\"docutils literal notranslate\">True</code>\non databases that support time zones. Previously, it was <code class=\"docutils literal notranslate\">None</code> on\ndatabases that support time zones.</p></li>\n<li><p><code class=\"docutils literal notranslate\">connection._nodb_connection</code> property is changed to the\n<code class=\"docutils literal notranslate\">connection._nodb_cursor()</code> method and now returns a context manager that\nyields a cursor and automatically closes the cursor and connection upon\nexiting the <code class=\"docutils literal notranslate\">with</code> statement.</p></li>\n<li><p><code class=\"docutils literal notranslate\">DatabaseClient.runshell()</code> now requires an additional <code class=\"docutils literal notranslate\">parameters</code>\nargument as a list of extra arguments to pass on to the command-line client.</p></li>\n<li><p>The <code class=\"docutils literal notranslate\">sequences</code> positional argument of <code class=\"docutils literal notranslate\">DatabaseOperations.sql_flush()</code>\nis replaced by the boolean keyword-only argument <code class=\"docutils literal notranslate\">reset_sequences</code>. If\n<code class=\"docutils literal notranslate\">True</code>, the sequences of the truncated tables will be reset.</p></li>\n<li><p>The <code class=\"docutils literal notranslate\">allow_cascade</code> argument of <code class=\"docutils literal notranslate\">DatabaseOperations.sql_flush()</code> is now a\nkeyword-only argument.</p></li>\n<li><p>The <code class=\"docutils literal notranslate\">using</code> positional argument of\n<code class=\"docutils literal notranslate\">DatabaseOperations.execute_sql_flush()</code> is removed. The method now uses\nthe database of the called instance.</p></li>\n<li><p>Third-party database backends must implement support for <code class=\"docutils literal notranslate\">JSONField</code> or set\n<code class=\"docutils literal notranslate\">DatabaseFeatures.supports_json_field</code> to <code class=\"docutils literal notranslate\">False</code>. If storing primitives\nis not supported, set <code class=\"docutils literal notranslate\">DatabaseFeatures.supports_primitives_in_json_field</code>\nto <code class=\"docutils literal notranslate\">False</code>. If there is a true datatype for JSON, set\n<code class=\"docutils literal notranslate\">DatabaseFeatures.has_native_json_field</code> to <code class=\"docutils literal notranslate\">True</code>. If\n<a class=\"reference internal\" href=\"/en/dev/topics/db/queries/#std-fieldlookup-jsonfield.contains\"><code class=\"xref std std-lookup docutils literal notranslate\">jsonfield.contains</code></a> and <a class=\"reference internal\" href=\"/en/dev/topics/db/queries/#std-fieldlookup-jsonfield.contained_by\"><code class=\"xref std std-lookup docutils literal notranslate\">jsonfield.contained_by</code></a> are not\nsupported, set <code class=\"docutils literal notranslate\">DatabaseFeatures.supports_json_field_contains</code> to\n<code class=\"docutils literal notranslate\">False</code>.</p></li>\n<li><p>Third party database backends must implement introspection for <code class=\"docutils literal notranslate\">JSONField</code>\nor set <code class=\"docutils literal notranslate\">can_introspect_json_field</code> to <code class=\"docutils literal notranslate\">False</code>.</p></li>\n</ul>\n</section>\n<section id=\"dropped-support-for-mariadb-10-1\">\n<h3>Dropped support for MariaDB 10.1<a class=\"heading-anchor\" href=\"#dropped-support-for-mariadb-10-1\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h3>\n<p>Upstream support for MariaDB 10.1 ends in October 2020. Django 3.1 supports\nMariaDB 10.2 and higher.</p>\n</section>\n<section id=\"contrib-admin-browser-support\">\n<h3><code class=\"docutils literal notranslate\">contrib.admin</code> browser support<a class=\"heading-anchor\" href=\"#contrib-admin-browser-support\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h3>\n<p>The admin no longer supports the legacy Internet Explorer browser. See\n<a class=\"reference internal\" href=\"/en/dev/faq/admin/#admin-browser-support\"><span class=\"std std-ref\">the admin FAQ</span></a> for details on supported browsers.</p>\n</section>\n<section id=\"abstractuser-first-name-max-length-increased-to-150\">\n<h3><a class=\"reference internal\" href=\"/en/dev/ref/contrib/auth/#django.contrib.auth.models.User.first_name\" title=\"django.contrib.auth.models.User.first_name\"><code class=\"xref py py-attr docutils literal notranslate\">AbstractUser.first_name</code></a> <code class=\"docutils literal notranslate\">max_length</code> increased to 150<a class=\"heading-anchor\" href=\"#abstractuser-first-name-max-length-increased-to-150\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h3>\n<p>A migration for <a class=\"reference internal\" href=\"/en/dev/ref/contrib/auth/#django.contrib.auth.models.User.first_name\" title=\"django.contrib.auth.models.User.first_name\"><code class=\"xref py py-attr docutils literal notranslate\">django.contrib.auth.models.User.first_name</code></a> is included.\nIf you have a custom user model inheriting from <code class=\"docutils literal notranslate\">AbstractUser</code>, you’ll need\nto generate and apply a database migration for your user model.</p>\n<p>If you want to preserve the 30 character limit for first names, use a custom\nform:</p>\n<div class=\"code-block\" data-language=\"default\"><div class=\"code-block-toolbar\"><span class=\"code-block-language\">Code</span><button type=\"button\" class=\"copy-button\" data-copy hidden><span class=\"copy-button-label\">Copy</span></button></div><pre role=\"group\" tabindex=\"0\" aria-label=\"Code code\"><code><span class=\"kn\">from</span> <span class=\"nn\">django</span> <span class=\"kn\">import</span> forms\n<span class=\"kn\">from</span> <span class=\"nn\">django.contrib.auth.forms</span> <span class=\"kn\">import</span> UserChangeForm\n\n\n<span class=\"k\">class</span> <span class=\"nc\">MyUserChangeForm</span><span class=\"p\">(</span>UserChangeForm<span class=\"p\">):</span>\n    first_name <span class=\"o\">=</span> forms<span class=\"o\">.</span>CharField<span class=\"p\">(</span>max_length<span class=\"o\">=</span><span class=\"mi\">30</span><span class=\"p\">,</span> required<span class=\"o\">=</span><span class=\"kc\">False</span><span class=\"p\">)</span>\n</code></pre></div>\n<p>If you wish to keep this restriction in the admin when editing users, set\n<code class=\"docutils literal notranslate\">UserAdmin.form</code> to use this form:</p>\n<div class=\"code-block\" data-language=\"default\"><div class=\"code-block-toolbar\"><span class=\"code-block-language\">Code</span><button type=\"button\" class=\"copy-button\" data-copy hidden><span class=\"copy-button-label\">Copy</span></button></div><pre role=\"group\" tabindex=\"0\" aria-label=\"Code code\"><code><span class=\"kn\">from</span> <span class=\"nn\">django.contrib.auth.admin</span> <span class=\"kn\">import</span> UserAdmin\n<span class=\"kn\">from</span> <span class=\"nn\">django.contrib.auth.models</span> <span class=\"kn\">import</span> User\n\n\n<span class=\"k\">class</span> <span class=\"nc\">MyUserAdmin</span><span class=\"p\">(</span>UserAdmin<span class=\"p\">):</span>\n    form <span class=\"o\">=</span> MyUserChangeForm\n\n\nadmin<span class=\"o\">.</span>site<span class=\"o\">.</span>unregister<span class=\"p\">(</span>User<span class=\"p\">)</span>\nadmin<span class=\"o\">.</span>site<span class=\"o\">.</span>register<span class=\"p\">(</span>User<span class=\"p\">,</span> MyUserAdmin<span class=\"p\">)</span>\n</code></pre></div>\n</section>\n<section id=\"id1\">\n<h3>Miscellaneous<a class=\"heading-anchor\" href=\"#id1\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h3>\n<ul class=\"simple\">\n<li><p>The cache keys used by <a class=\"reference internal\" href=\"/en/dev/topics/cache/#std-templatetag-cache\"><code class=\"xref std std-ttag docutils literal notranslate\">cache</code></a> and generated by\n<a class=\"reference internal\" href=\"/en/dev/topics/cache/#django.core.cache.utils.make_template_fragment_key\" title=\"django.core.cache.utils.make_template_fragment_key\"><code class=\"xref py py-func docutils literal notranslate\">make_template_fragment_key()</code></a> are different\nfrom the keys generated by older versions of Django. After upgrading to\nDjango 3.1, the first request to any previously cached template fragment will\nbe a cache miss.</p></li>\n<li><p>The logic behind the decision to return a redirection fallback or a 204 HTTP\nresponse from the <a class=\"reference internal\" href=\"/en/dev/topics/i18n/translation/#django.views.i18n.set_language\" title=\"django.views.i18n.set_language\"><code class=\"xref py py-func docutils literal notranslate\">set_language()</code></a> view is now based\non the <code class=\"docutils literal notranslate\">Accept</code> HTTP header instead of the <code class=\"docutils literal notranslate\">X-Requested-With</code> HTTP header\npresence.</p></li>\n<li><p>The compatibility imports of <code class=\"docutils literal notranslate\">django.core.exceptions.EmptyResultSet</code> in\n<code class=\"docutils literal notranslate\">django.db.models.query</code>, <code class=\"docutils literal notranslate\">django.db.models.sql</code>, and\n<code class=\"docutils literal notranslate\">django.db.models.sql.datastructures</code> are removed.</p></li>\n<li><p>The compatibility import of <code class=\"docutils literal notranslate\">django.core.exceptions.FieldDoesNotExist</code> in\n<code class=\"docutils literal notranslate\">django.db.models.fields</code> is removed.</p></li>\n<li><p>The compatibility imports of <code class=\"docutils literal notranslate\">django.forms.utils.pretty_name()</code> and\n<code class=\"docutils literal notranslate\">django.forms.boundfield.BoundField</code> in <code class=\"docutils literal notranslate\">django.forms.forms</code> are removed.</p></li>\n<li><p>The compatibility imports of <code class=\"docutils literal notranslate\">Context</code>, <code class=\"docutils literal notranslate\">ContextPopException</code>, and\n<code class=\"docutils literal notranslate\">RequestContext</code> in <code class=\"docutils literal notranslate\">django.template.base</code> are removed.</p></li>\n<li><p>The compatibility import of\n<code class=\"docutils literal notranslate\">django.contrib.admin.helpers.ACTION_CHECKBOX_NAME</code> in\n<code class=\"docutils literal notranslate\">django.contrib.admin</code> is removed.</p></li>\n<li><p>The <a class=\"reference internal\" href=\"/en/dev/ref/settings/#std-setting-STATIC_URL\"><code class=\"xref std std-setting docutils literal notranslate\">STATIC_URL</code></a> and <a class=\"reference internal\" href=\"/en/dev/ref/settings/#std-setting-MEDIA_URL\"><code class=\"xref std std-setting docutils literal notranslate\">MEDIA_URL</code></a> settings set to relative\npaths are now prefixed by the server-provided value of <code class=\"docutils literal notranslate\">SCRIPT_NAME</code> (or\n<code class=\"docutils literal notranslate\">/</code> if not set). This change should not affect settings set to valid URLs\nor absolute paths.</p></li>\n<li><p><a class=\"reference internal\" href=\"/en/dev/ref/middleware/#django.middleware.http.ConditionalGetMiddleware\" title=\"django.middleware.http.ConditionalGetMiddleware\"><code class=\"xref py py-class docutils literal notranslate\">ConditionalGetMiddleware</code></a> no longer adds the\n<code class=\"docutils literal notranslate\">ETag</code> header to responses with an empty\n<a class=\"reference internal\" href=\"/en/dev/ref/request-response/#django.http.HttpResponse.content\" title=\"django.http.HttpResponse.content\"><code class=\"xref py py-attr docutils literal notranslate\">content</code></a>.</p></li>\n<li><p><code class=\"docutils literal notranslate\">django.utils.decorators.classproperty()</code> decorator is made public and\nmoved to <a class=\"reference internal\" href=\"/en/dev/ref/utils/#django.utils.functional.classproperty\" title=\"django.utils.functional.classproperty\"><code class=\"xref py py-class docutils literal notranslate\">django.utils.functional.classproperty</code></a>.</p></li>\n<li><p><a class=\"reference internal\" href=\"/en/dev/ref/templates/builtins/#std-templatefilter-floatformat\"><code class=\"xref std std-tfilter docutils literal notranslate\">floatformat</code></a> template filter now outputs (positive) <code class=\"docutils literal notranslate\">0</code> for\nnegative numbers which round to zero.</p></li>\n<li><p><a class=\"reference internal\" href=\"/en/dev/ref/models/options/#django.db.models.Options.ordering\" title=\"django.db.models.Options.ordering\"><code class=\"xref py py-attr docutils literal notranslate\">Meta.ordering</code></a> and\n<a class=\"reference internal\" href=\"/en/dev/ref/models/options/#django.db.models.Options.unique_together\" title=\"django.db.models.Options.unique_together\"><code class=\"xref py py-attr docutils literal notranslate\">Meta.unique_together</code></a>\noptions on models in <code class=\"docutils literal notranslate\">django.contrib</code> modules that were formerly tuples are\nnow lists.</p></li>\n<li><p>The admin calendar widget now handles two-digit years according to the Open\nGroup Specification, i.e. values between 69 and 99 are mapped to the previous\ncentury, and values between 0 and 68 are mapped to the current century.</p></li>\n<li><p>Date-only formats are removed from the default list for\n<a class=\"reference internal\" href=\"/en/dev/ref/settings/#std-setting-DATETIME_INPUT_FORMATS\"><code class=\"xref std std-setting docutils literal notranslate\">DATETIME_INPUT_FORMATS</code></a>.</p></li>\n<li><p>The <a class=\"reference internal\" href=\"/en/dev/ref/forms/widgets/#django.forms.FileInput\" title=\"django.forms.FileInput\"><code class=\"xref py py-class docutils literal notranslate\">FileInput</code></a> widget no longer renders with the\n<code class=\"docutils literal notranslate\">required</code> HTML attribute when initial data exists.</p></li>\n<li><p>The undocumented <code class=\"docutils literal notranslate\">django.views.debug.ExceptionReporterFilter</code> class is\nremoved. As per the <a class=\"reference internal\" href=\"/en/dev/howto/error-reporting/#custom-error-reports\"><span class=\"std std-ref\">Custom error reports</span></a> documentation, classes to be\nused with <a class=\"reference internal\" href=\"/en/dev/ref/settings/#std-setting-DEFAULT_EXCEPTION_REPORTER_FILTER\"><code class=\"xref std std-setting docutils literal notranslate\">DEFAULT_EXCEPTION_REPORTER_FILTER</code></a> need to inherit from\n<a class=\"reference internal\" href=\"/en/dev/howto/error-reporting/#django.views.debug.SafeExceptionReporterFilter\" title=\"django.views.debug.SafeExceptionReporterFilter\"><code class=\"xref py py-class docutils literal notranslate\">django.views.debug.SafeExceptionReporterFilter</code></a>.</p></li>\n<li><p>The cache timeout set by <a class=\"reference internal\" href=\"/en/dev/topics/cache/#django.views.decorators.cache.cache_page\" title=\"django.views.decorators.cache.cache_page\"><code class=\"xref py py-func docutils literal notranslate\">cache_page()</code></a>\ndecorator now takes precedence over the <code class=\"docutils literal notranslate\">max-age</code> directive from the\n<code class=\"docutils literal notranslate\">Cache-Control</code> header.</p></li>\n<li><p>Providing a non-local remote field in the <a class=\"reference internal\" href=\"/en/dev/ref/models/fields/#django.db.models.ForeignKey.to_field\" title=\"django.db.models.ForeignKey.to_field\"><code class=\"xref py py-attr docutils literal notranslate\">ForeignKey.to_field</code></a>\nargument now raises <a class=\"reference internal\" href=\"/en/dev/ref/exceptions/#django.core.exceptions.FieldError\" title=\"django.core.exceptions.FieldError\"><code class=\"xref py py-class docutils literal notranslate\">FieldError</code></a>.</p></li>\n<li><p><a class=\"reference internal\" href=\"/en/dev/ref/settings/#std-setting-SECURE_REFERRER_POLICY\"><code class=\"xref std std-setting docutils literal notranslate\">SECURE_REFERRER_POLICY</code></a> now defaults to <code class=\"docutils literal notranslate\">'same-origin'</code>. See the\n<em>What’s New</em> <a class=\"reference internal\" href=\"#whats-new-security-3-1\"><span class=\"std std-ref\">Security section</span></a> above for more\ndetails.</p></li>\n<li><p><a class=\"reference internal\" href=\"/en/dev/ref/django-admin/#django-admin-check\"><code class=\"xref std std-djadmin docutils literal notranslate\">check</code></a> management command now runs the <code class=\"docutils literal notranslate\">database</code> system checks\nonly for database aliases specified using <a class=\"reference internal\" href=\"/en/dev/ref/django-admin/#cmdoption-check-database\"><code class=\"xref std std-option docutils literal notranslate\">check --database</code></a> option.</p></li>\n<li><p><a class=\"reference internal\" href=\"/en/dev/ref/django-admin/#django-admin-migrate\"><code class=\"xref std std-djadmin docutils literal notranslate\">migrate</code></a> management command now runs the <code class=\"docutils literal notranslate\">database</code> system checks\nonly for a database to migrate.</p></li>\n<li><p>The admin CSS classes <code class=\"docutils literal notranslate\">row1</code> and <code class=\"docutils literal notranslate\">row2</code> are removed in favor of\n<code class=\"docutils literal notranslate\">:nth-child(odd)</code> and <code class=\"docutils literal notranslate\">:nth-child(even)</code> pseudo-classes.</p></li>\n<li><p>The <a class=\"reference internal\" href=\"/en/dev/topics/auth/passwords/#django.contrib.auth.hashers.make_password\" title=\"django.contrib.auth.hashers.make_password\"><code class=\"xref py py-func docutils literal notranslate\">make_password()</code></a> function now requires\nits argument to be a string or bytes. Other types should be explicitly cast\nto one of these.</p></li>\n<li><p>The undocumented <code class=\"docutils literal notranslate\">version</code> parameter to the\n<a class=\"reference internal\" href=\"/en/dev/ref/contrib/gis/functions/#django.contrib.gis.db.models.functions.AsKML\" title=\"django.contrib.gis.db.models.functions.AsKML\"><code class=\"xref py py-class docutils literal notranslate\">AsKML</code></a> function is removed.</p></li>\n<li><p><a class=\"reference internal\" href=\"/en/dev/topics/serialization/#serialization-formats\"><span class=\"std std-ref\">JSON and YAML serializers</span></a>, used by\n<a class=\"reference internal\" href=\"/en/dev/ref/django-admin/#django-admin-dumpdata\"><code class=\"xref std std-djadmin docutils literal notranslate\">dumpdata</code></a>, now dump all data with Unicode by default. If you need\nthe previous behavior, pass <code class=\"docutils literal notranslate\">ensure_ascii=True</code> to JSON serializer, or\n<code class=\"docutils literal notranslate\">allow_unicode=False</code> to YAML serializer.</p></li>\n<li><p>The auto-reloader no longer monitors changes in built-in Django translation\nfiles.</p></li>\n<li><p>The minimum supported version of <code class=\"docutils literal notranslate\">mysqlclient</code> is increased from 1.3.13 to\n1.4.0.</p></li>\n<li><p>The undocumented <code class=\"docutils literal notranslate\">django.contrib.postgres.forms.InvalidJSONInput</code> and\n<code class=\"docutils literal notranslate\">django.contrib.postgres.forms.JSONString</code> are moved to\n<code class=\"docutils literal notranslate\">django.forms.fields</code>.</p></li>\n<li><p>The undocumented <code class=\"docutils literal notranslate\">django.contrib.postgres.fields.jsonb.JsonAdapter</code> class\nis removed.</p></li>\n<li><p>The <a class=\"reference internal\" href=\"/en/dev/topics/i18n/formatting/#std-templatetag-localize\"><code class=\"xref std std-ttag docutils literal notranslate\">{% localize off %}</code></a> tag and <a class=\"reference internal\" href=\"/en/dev/topics/i18n/formatting/#std-templatefilter-unlocalize\"><code class=\"xref std std-tfilter docutils literal notranslate\">unlocalize</code></a>\nfilter no longer respect <a class=\"reference internal\" href=\"/en/dev/ref/settings/#std-setting-DECIMAL_SEPARATOR\"><code class=\"xref std std-setting docutils literal notranslate\">DECIMAL_SEPARATOR</code></a> setting.</p></li>\n<li><p>The minimum supported version of <code class=\"docutils literal notranslate\">asgiref</code> is increased from 3.2 to\n3.2.10.</p></li>\n<li><p>The <a class=\"reference internal\" href=\"/en/dev/topics/forms/media/\"><span class=\"doc\">Media</span></a> class now renders <code class=\"docutils literal notranslate\">&lt;script&gt;</code> tags\nwithout the <code class=\"docutils literal notranslate\">type</code> attribute to follow <a class=\"reference external\" href=\"https://html.spec.whatwg.org/multipage/scripting.html#the-script-element\">WHATWG recommendations</a>.</p></li>\n<li><p><a class=\"reference internal\" href=\"/en/dev/ref/forms/fields/#django.forms.ModelChoiceIterator\" title=\"django.forms.ModelChoiceIterator\"><code class=\"xref py py-class docutils literal notranslate\">ModelChoiceIterator</code></a>, used by\n<a class=\"reference internal\" href=\"/en/dev/ref/forms/fields/#django.forms.ModelChoiceField\" title=\"django.forms.ModelChoiceField\"><code class=\"xref py py-class docutils literal notranslate\">ModelChoiceField</code></a> and\n<a class=\"reference internal\" href=\"/en/dev/ref/forms/fields/#django.forms.ModelMultipleChoiceField\" title=\"django.forms.ModelMultipleChoiceField\"><code class=\"xref py py-class docutils literal notranslate\">ModelMultipleChoiceField</code></a>, now yields 2-tuple choices\ncontaining <a class=\"reference internal\" href=\"/en/dev/ref/forms/fields/#django.forms.ModelChoiceIteratorValue\" title=\"django.forms.ModelChoiceIteratorValue\"><code class=\"xref py py-class docutils literal notranslate\">ModelChoiceIteratorValue</code></a> instances as the\nfirst <code class=\"docutils literal notranslate\">value</code> element in each choice. In most cases this proxies\ntransparently, but if you need the <code class=\"docutils literal notranslate\">field</code> value itself, use the\n<a class=\"reference internal\" href=\"/en/dev/ref/forms/fields/#django.forms.ModelChoiceIteratorValue.value\" title=\"django.forms.ModelChoiceIteratorValue.value\"><code class=\"xref py py-attr docutils literal notranslate\">ModelChoiceIteratorValue.value</code></a> attribute instead.</p></li>\n</ul>\n</section>\n</section>\n<section id=\"features-deprecated-in-3-1\">\n<span id=\"deprecated-features-3-1\"></span><h2>Features deprecated in 3.1<a class=\"heading-anchor\" href=\"#features-deprecated-in-3-1\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h2>\n<section id=\"postgresql-jsonfield\">\n<span id=\"deprecated-jsonfield\"></span><h3>PostgreSQL <code class=\"docutils literal notranslate\">JSONField</code><a class=\"heading-anchor\" href=\"#postgresql-jsonfield\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h3>\n<p><code class=\"docutils literal notranslate\">django.contrib.postgres.fields.JSONField</code> and\n<code class=\"docutils literal notranslate\">django.contrib.postgres.forms.JSONField</code> are deprecated in favor of\n<a class=\"reference internal\" href=\"/en/dev/ref/models/fields/#django.db.models.JSONField\" title=\"django.db.models.JSONField\"><code class=\"xref py py-class docutils literal notranslate\">models.JSONField</code></a> and\n<a class=\"reference internal\" href=\"/en/dev/ref/forms/fields/#django.forms.JSONField\" title=\"django.forms.JSONField\"><code class=\"xref py py-class docutils literal notranslate\">forms.JSONField</code></a>.</p>\n<p>The undocumented <code class=\"docutils literal notranslate\">django.contrib.postgres.fields.jsonb.KeyTransform</code> and\n<code class=\"docutils literal notranslate\">django.contrib.postgres.fields.jsonb.KeyTextTransform</code> are also deprecated\nin favor of the transforms in <code class=\"docutils literal notranslate\">django.db.models.fields.json</code>.</p>\n<p>The new <code class=\"docutils literal notranslate\">JSONField</code>s, <code class=\"docutils literal notranslate\">KeyTransform</code>, and <code class=\"docutils literal notranslate\">KeyTextTransform</code> can be used\non all supported database backends.</p>\n</section>\n<section id=\"id2\">\n<h3>Miscellaneous<a class=\"heading-anchor\" href=\"#id2\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h3>\n<ul>\n<li><p><code class=\"docutils literal notranslate\">PASSWORD_RESET_TIMEOUT_DAYS</code> setting is deprecated in favor of\n<a class=\"reference internal\" href=\"/en/dev/ref/settings/#std-setting-PASSWORD_RESET_TIMEOUT\"><code class=\"xref std std-setting docutils literal notranslate\">PASSWORD_RESET_TIMEOUT</code></a>.</p></li>\n<li><p>The undocumented usage of the <a class=\"reference internal\" href=\"/en/dev/ref/models/querysets/#std-fieldlookup-isnull\"><code class=\"xref std std-lookup docutils literal notranslate\">isnull</code></a> lookup with non-boolean values\nas the right-hand side is deprecated, use <code class=\"docutils literal notranslate\">True</code> or <code class=\"docutils literal notranslate\">False</code> instead.</p></li>\n<li><p>The barely documented <code class=\"docutils literal notranslate\">django.db.models.query_utils.InvalidQuery</code> exception\nclass is deprecated in favor of\n<a class=\"reference internal\" href=\"/en/dev/ref/exceptions/#django.core.exceptions.FieldDoesNotExist\" title=\"django.core.exceptions.FieldDoesNotExist\"><code class=\"xref py py-class docutils literal notranslate\">FieldDoesNotExist</code></a> and\n<a class=\"reference internal\" href=\"/en/dev/ref/exceptions/#django.core.exceptions.FieldError\" title=\"django.core.exceptions.FieldError\"><code class=\"xref py py-class docutils literal notranslate\">FieldError</code></a>.</p></li>\n<li><p>The <code class=\"docutils literal notranslate\">django-admin.py</code> entry point is deprecated in favor of\n<code class=\"docutils literal notranslate\">django-admin</code>.</p></li>\n<li><p>The <code class=\"docutils literal notranslate\">HttpRequest.is_ajax()</code> method is deprecated as it relied on a\njQuery-specific way of signifying AJAX calls, while current usage tends to\nuse the JavaScript <a class=\"reference external\" href=\"https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API\">Fetch API</a>. Depending on\nyour use case, you can either write your own AJAX detection method, or use\nthe new <a class=\"reference internal\" href=\"/en/dev/ref/request-response/#django.http.HttpRequest.accepts\" title=\"django.http.HttpRequest.accepts\"><code class=\"xref py py-meth docutils literal notranslate\">HttpRequest.accepts()</code></a> method if your code depends on the\nclient <code class=\"docutils literal notranslate\">Accept</code> HTTP header.</p>\n<p>If you are writing your own AJAX detection method, <code class=\"docutils literal notranslate\">request.is_ajax()</code> can\nbe reproduced exactly as\n<code class=\"docutils literal notranslate\">request.headers.get('x-requested-with') == 'XMLHttpRequest'</code>.</p>\n</li>\n<li><p>Passing <code class=\"docutils literal notranslate\">None</code> as the first argument to\n<code class=\"docutils literal notranslate\">django.utils.deprecation.MiddlewareMixin.__init__()</code> is deprecated.</p></li>\n<li><p>The encoding format of cookies values used by\n<a class=\"reference internal\" href=\"/en/dev/ref/contrib/messages/#django.contrib.messages.storage.cookie.CookieStorage\" title=\"django.contrib.messages.storage.cookie.CookieStorage\"><code class=\"xref py py-class docutils literal notranslate\">CookieStorage</code></a> is different\nfrom the format generated by older versions of Django. Support for the old\nformat remains until Django 4.0.</p></li>\n<li><p>The encoding format of sessions is different from the format generated by\nolder versions of Django. Support for the old format remains until Django\n4.0.</p></li>\n<li><p>The purely documentational <code class=\"docutils literal notranslate\">providing_args</code> argument for\n<a class=\"reference internal\" href=\"/en/dev/topics/signals/#django.dispatch.Signal\" title=\"django.dispatch.Signal\"><code class=\"xref py py-class docutils literal notranslate\">Signal</code></a> is deprecated. If you rely on this\nargument as documentation, you can move the text to a code comment or\ndocstring.</p></li>\n<li><p>Calling <code class=\"docutils literal notranslate\">django.utils.crypto.get_random_string()</code> without a <code class=\"docutils literal notranslate\">length</code>\nargument is deprecated.</p></li>\n<li><p>The <code class=\"docutils literal notranslate\">list</code> message for <a class=\"reference internal\" href=\"/en/dev/ref/forms/fields/#django.forms.ModelMultipleChoiceField\" title=\"django.forms.ModelMultipleChoiceField\"><code class=\"xref py py-class docutils literal notranslate\">ModelMultipleChoiceField</code></a> is\ndeprecated in favor of <code class=\"docutils literal notranslate\">invalid_list</code>.</p></li>\n<li><p>Passing raw column aliases to <a class=\"reference internal\" href=\"/en/dev/ref/models/querysets/#django.db.models.query.QuerySet.order_by\" title=\"django.db.models.query.QuerySet.order_by\"><code class=\"xref py py-meth docutils literal notranslate\">QuerySet.order_by()</code></a> is deprecated. The\nsame result can be achieved by passing aliases in a\n<a class=\"reference internal\" href=\"/en/dev/ref/models/expressions/#django.db.models.expressions.RawSQL\" title=\"django.db.models.expressions.RawSQL\"><code class=\"xref py py-class docutils literal notranslate\">RawSQL</code></a> instead beforehand.</p></li>\n<li><p>The <code class=\"docutils literal notranslate\">NullBooleanField</code> model field is deprecated in favor of\n<code class=\"docutils literal notranslate\">BooleanField(null=True, blank=True)</code>.</p></li>\n<li><p><code class=\"docutils literal notranslate\">django.conf.urls.url()</code> alias of <a class=\"reference internal\" href=\"/en/dev/ref/urls/#django.urls.re_path\" title=\"django.urls.re_path\"><code class=\"xref py py-func docutils literal notranslate\">django.urls.re_path()</code></a> is\ndeprecated.</p></li>\n<li><p>The <code class=\"docutils literal notranslate\">{% ifequal %}</code> and <code class=\"docutils literal notranslate\">{% ifnotequal %}</code> template tags are deprecated\nin favor of <a class=\"reference internal\" href=\"/en/dev/ref/templates/builtins/#std-templatetag-if\"><code class=\"xref std std-ttag docutils literal notranslate\">{% if %}</code></a>. <code class=\"docutils literal notranslate\">{% if %}</code> covers all use cases, but if\nyou need to continue using these tags, they can be extracted from Django to a\nmodule and included as a built-in tag in the <a class=\"reference internal\" href=\"/en/dev/topics/templates/#django.template.backends.django.DjangoTemplates\" title=\"django.template.backends.django.DjangoTemplates\"><code class=\"xref py py-class docutils literal notranslate\">'builtins'</code></a> option in\n<a class=\"reference internal\" href=\"/en/dev/ref/settings/#std-setting-TEMPLATES-OPTIONS\"><code class=\"xref std std-setting docutils literal notranslate\">OPTIONS</code></a>.</p></li>\n<li><p><code class=\"docutils literal notranslate\">DEFAULT_HASHING_ALGORITHM</code> transitional setting is deprecated.</p></li>\n</ul>\n</section>\n</section>\n<section id=\"features-removed-in-3-1\">\n<span id=\"removed-features-3-1\"></span><h2>Features removed in 3.1<a class=\"heading-anchor\" href=\"#features-removed-in-3-1\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h2>\n<p>These features have reached the end of their deprecation cycle and are removed\nin Django 3.1.</p>\n<p>See <a class=\"reference internal\" href=\"/en/dev/releases/2.2/#deprecated-features-2-2\"><span class=\"std std-ref\">Features deprecated in 2.2</span></a> for details on these changes, including how\nto remove usage of these features.</p>\n<ul class=\"simple\">\n<li><p><code class=\"docutils literal notranslate\">django.utils.timezone.FixedOffset</code> is removed.</p></li>\n<li><p><code class=\"docutils literal notranslate\">django.core.paginator.QuerySetPaginator</code> is removed.</p></li>\n<li><p>A model’s <code class=\"docutils literal notranslate\">Meta.ordering</code> doesn’t affect <code class=\"docutils literal notranslate\">GROUP BY</code> queries.</p></li>\n<li><p><code class=\"docutils literal notranslate\">django.contrib.postgres.fields.FloatRangeField</code> and\n<code class=\"docutils literal notranslate\">django.contrib.postgres.forms.FloatRangeField</code> are removed.</p></li>\n<li><p>The <code class=\"docutils literal notranslate\">FILE_CHARSET</code> setting is removed.</p></li>\n<li><p><code class=\"docutils literal notranslate\">django.contrib.staticfiles.storage.CachedStaticFilesStorage</code> is removed.</p></li>\n<li><p>The <code class=\"docutils literal notranslate\">RemoteUserBackend.configure_user()</code> method requires <code class=\"docutils literal notranslate\">request</code> as the\nfirst positional argument.</p></li>\n<li><p>Support for <code class=\"docutils literal notranslate\">SimpleTestCase.allow_database_queries</code> and\n<code class=\"docutils literal notranslate\">TransactionTestCase.multi_db</code> is removed.</p></li>\n</ul>\n</section>","rootId":"django-3-1-release-notes","toc":[{"title":"Python compatibility","anchor":"python-compatibility","children":[]},{"title":"What’s new in Django 3.1","anchor":"what-s-new-in-django-3-1","children":[{"title":"Asynchronous views and middleware support","anchor":"asynchronous-views-and-middleware-support","children":[]},{"title":"JSONField for all supported database backends","anchor":"jsonfield-for-all-supported-database-backends","children":[]},{"title":"DEFAULT_HASHING_ALGORITHM settings","anchor":"default-hashing-algorithm-settings","children":[]},{"title":"Minor features","anchor":"minor-features","children":[{"title":"django.contrib.admin","anchor":"django-contrib-admin","children":[]},{"title":"django.contrib.auth","anchor":"django-contrib-auth","children":[]},{"title":"django.contrib.contenttypes","anchor":"django-contrib-contenttypes","children":[]},{"title":"django.contrib.gis","anchor":"django-contrib-gis","children":[]},{"title":"django.contrib.humanize","anchor":"django-contrib-humanize","children":[]},{"title":"django.contrib.postgres","anchor":"django-contrib-postgres","children":[]},{"title":"django.contrib.sessions","anchor":"django-contrib-sessions","children":[]},{"title":"django.contrib.staticfiles","anchor":"django-contrib-staticfiles","children":[]},{"title":"Cache","anchor":"cache","children":[]},{"title":"CSRF","anchor":"csrf","children":[]},{"title":"Email","anchor":"email","children":[]},{"title":"Error Reporting","anchor":"error-reporting","children":[]},{"title":"File Storage","anchor":"file-storage","children":[]},{"title":"Forms","anchor":"forms","children":[]},{"title":"Internationalization","anchor":"internationalization","children":[]},{"title":"Management Commands","anchor":"management-commands","children":[]},{"title":"Models","anchor":"models","children":[]},{"title":"Pagination","anchor":"pagination","children":[]},{"title":"Requests and Responses","anchor":"requests-and-responses","children":[]},{"title":"Security","anchor":"security","children":[]},{"title":"Templates","anchor":"templates","children":[]},{"title":"Tests","anchor":"tests","children":[]},{"title":"URLs","anchor":"urls","children":[]},{"title":"Utilities","anchor":"utilities","children":[]},{"title":"Miscellaneous","anchor":"miscellaneous","children":[]}]}]},{"title":"Backwards incompatible changes in 3.1","anchor":"backwards-incompatible-changes-in-3-1","children":[{"title":"Database backend API","anchor":"database-backend-api","children":[]},{"title":"Dropped support for MariaDB 10.1","anchor":"dropped-support-for-mariadb-10-1","children":[]},{"title":"contrib.admin browser support","anchor":"contrib-admin-browser-support","children":[]},{"title":"AbstractUser.first_name max_length increased to 150","anchor":"abstractuser-first-name-max-length-increased-to-150","children":[]},{"title":"Miscellaneous","anchor":"id1","children":[]}]},{"title":"Features deprecated in 3.1","anchor":"features-deprecated-in-3-1","children":[{"title":"PostgreSQL JSONField","anchor":"postgresql-jsonfield","children":[]},{"title":"Miscellaneous","anchor":"id2","children":[]}]},{"title":"Features removed in 3.1","anchor":"features-removed-in-3-1","children":[]}],"breadcrumbs":[{"docname":"releases/index","title":"Release notes","url":"/en/dev/releases/"}],"prev":{"docname":"releases/3.1.1","title":"Django 3.1.1 release notes","url":"/en/dev/releases/3.1.1/"},"next":{"docname":"releases/3.0.14","title":"Django 3.0.14 release notes","url":"/en/dev/releases/3.0.14/"},"formats":{"html":"/en/dev/releases/3.1/","markdown":"/en/dev/releases/3.1.md","json":"/en/dev/releases/3.1.json"},"source":"https://github.com/django/django/blob/main/docs/releases/3.1.txt","official":"https://docs.djangoproject.com/en/dev/releases/3.1/","inVersions":["dev","6.1","6.0","5.2","5.1","5.0","4.2","4.1","4.0","3.2","3.1"],"inLocales":["en"]}