{"title":"Django 6.0 release notes","version":"dev","locale":"en","docname":"releases/6.0","url":"/en/dev/releases/6.0/","canonical":"https://djangodocs.dev/en/dev/releases/6.0/","summary":"Welcome to Django 6.0! These release notes cover the new features, as well as some backwards incompatible changes you should be aware of when upgrading from…","html":"<h1>Django 6.0 release notes<a class=\"heading-anchor\" href=\"#django-6-0-release-notes\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h1>\n<p><em>December 3, 2025</em></p>\n<p>Welcome to Django 6.0!</p>\n<p>These release notes cover the <a class=\"reference internal\" href=\"#whats-new-6-0\"><span class=\"std std-ref\">new features</span></a>, as well as\nsome <a class=\"reference internal\" href=\"#backwards-incompatible-6-0\"><span class=\"std std-ref\">backwards incompatible changes</span></a> you\nshould be aware of when upgrading from Django 5.2 or earlier. We’ve\n<a class=\"reference internal\" href=\"#deprecated-features-6-0\"><span class=\"std std-ref\">begun the deprecation process for some 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 6.0 supports Python 3.12, 3.13, and 3.14. We <strong>highly recommend</strong>, and\nonly officially support, the latest release of each series.</p>\n<p>The Django 5.2.x series is the last to support Python 3.10 and 3.11.</p>\n</section>\n<section id=\"third-party-library-support-for-older-versions-of-django\">\n<h2>Third-party library support for older versions of Django<a class=\"heading-anchor\" href=\"#third-party-library-support-for-older-versions-of-django\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h2>\n<p>Following the release of Django 6.0, we suggest that third-party app authors\ndrop support for all versions of Django prior to 5.2. At that time, you should\nbe able to run your package’s tests using <code class=\"docutils literal notranslate\">python -Wd</code> so that deprecation\nwarnings appear. After making the deprecation warning fixes, your app should be\ncompatible with Django 6.0.</p>\n</section>\n<section id=\"what-s-new-in-django-6-0\">\n<span id=\"whats-new-6-0\"></span><h2>What’s new in Django 6.0<a class=\"heading-anchor\" href=\"#what-s-new-in-django-6-0\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h2>\n<section id=\"content-security-policy-support\">\n<h3>Content Security Policy support<a class=\"heading-anchor\" href=\"#content-security-policy-support\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h3>\n<p>Built-in support for the <a class=\"reference internal\" href=\"/en/dev/topics/security/#security-csp\"><span class=\"std std-ref\">Content Security Policy (CSP)</span></a>\nstandard is now available, making it easier to protect web applications against\ncontent injection attacks such as cross-site scripting (XSS). CSP allows\ndeclaring trusted sources of content by giving browsers strict rules about\nwhich scripts, styles, images, or other resources can be loaded.</p>\n<p>CSP policies can now be enforced or monitored directly using built-in tools:\nheaders are added via the\n<a class=\"reference internal\" href=\"/en/dev/ref/middleware/#django.middleware.csp.ContentSecurityPolicyMiddleware\" title=\"django.middleware.csp.ContentSecurityPolicyMiddleware\"><code class=\"xref py py-class docutils literal notranslate\">ContentSecurityPolicyMiddleware</code></a>, nonces are\nsupported through the <a class=\"reference internal\" href=\"/en/dev/ref/templates/api/#django.template.context_processors.csp\" title=\"django.template.context_processors.csp\"><code class=\"xref py py-func docutils literal notranslate\">csp()</code></a> context\nprocessor, and policies are configured using the <a class=\"reference internal\" href=\"/en/dev/ref/settings/#std-setting-SECURE_CSP\"><code class=\"xref std std-setting docutils literal notranslate\">SECURE_CSP</code></a> and\n<a class=\"reference internal\" href=\"/en/dev/ref/settings/#std-setting-SECURE_CSP_REPORT_ONLY\"><code class=\"xref std std-setting docutils literal notranslate\">SECURE_CSP_REPORT_ONLY</code></a> settings.</p>\n<p>These settings accept Python dictionaries and support Django-provided constants\nfor clarity and safety. For example:</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.utils.csp</span> <span class=\"kn\">import</span> CSP\n\nSECURE_CSP <span class=\"o\">=</span> <span class=\"p\">{</span>\n    <span class=\"s2\">&quot;default-src&quot;</span><span class=\"p\">:</span> <span class=\"p\">[</span>CSP<span class=\"o\">.</span>SELF<span class=\"p\">],</span>\n    <span class=\"s2\">&quot;script-src&quot;</span><span class=\"p\">:</span> <span class=\"p\">[</span>CSP<span class=\"o\">.</span>SELF<span class=\"p\">,</span> CSP<span class=\"o\">.</span>NONCE<span class=\"p\">],</span>\n    <span class=\"s2\">&quot;img-src&quot;</span><span class=\"p\">:</span> <span class=\"p\">[</span>CSP<span class=\"o\">.</span>SELF<span class=\"p\">,</span> <span class=\"s2\">&quot;https:&quot;</span><span class=\"p\">],</span>\n<span class=\"p\">}</span>\n</code></pre></div>\n<p>The resulting <code class=\"docutils literal notranslate\">Content-Security-Policy</code> header would be set to:</p>\n<div class=\"code-block\" data-language=\"text\"><div class=\"code-block-toolbar\"><span class=\"code-block-language\">Text</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=\"Text code\"><code>default-src &#39;self&#39;; script-src &#39;self&#39; &#39;nonce-SECRET&#39;; img-src &#39;self&#39; https:\n</code></pre></div>\n<p>To get started, follow the <a class=\"reference internal\" href=\"/en/dev/howto/csp/\"><span class=\"doc\">CSP how-to guide</span></a>. For in-depth\nguidance, see the <a class=\"reference internal\" href=\"/en/dev/topics/security/#security-csp\"><span class=\"std std-ref\">CSP security overview</span></a> and the\n<a class=\"reference internal\" href=\"/en/dev/ref/csp/\"><span class=\"doc\">reference docs</span></a>, which include details about decorators to\noverride or disable policies on a per-view basis.</p>\n</section>\n<section id=\"template-partials\">\n<h3>Template Partials<a class=\"heading-anchor\" href=\"#template-partials\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h3>\n<p>The <a class=\"reference internal\" href=\"/en/dev/topics/templates/#template-language-intro\"><span class=\"std std-ref\">Django Template Language</span></a> now supports\n<a class=\"reference internal\" href=\"/en/dev/ref/templates/language/#template-partials\"><span class=\"std std-ref\">template partials</span></a>, making it easier to encapsulate\nand reuse small named fragments within a template file. The new tags\n<a class=\"reference internal\" href=\"/en/dev/ref/templates/builtins/#std-templatetag-partialdef\"><code class=\"xref std std-ttag docutils literal notranslate\">{% partialdef %}</code></a> and <a class=\"reference internal\" href=\"/en/dev/ref/templates/builtins/#std-templatetag-partial\"><code class=\"xref std std-ttag docutils literal notranslate\">{% partial %}</code></a>\ndefine a partial and render it, respectively.</p>\n<p>Partials can also be referenced using the <code class=\"docutils literal notranslate\">template_name#partial_name</code> syntax\nwith <a class=\"reference internal\" href=\"/en/dev/ref/templates/api/#django.template.Engine.get_template\" title=\"django.template.Engine.get_template\"><code class=\"xref py py-func docutils literal notranslate\">get_template()</code></a>,\n<a class=\"reference internal\" href=\"/en/dev/topics/http/shortcuts/#django.shortcuts.render\" title=\"django.shortcuts.render\"><code class=\"xref py py-func docutils literal notranslate\">render()</code></a>, <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>, and other\ntemplate-loading tools, enabling more modular and maintainable templates\nwithout needing to split components into separate files.</p>\n<p>A <a class=\"reference external\" href=\"https://github.com/carltongibson/django-template-partials/blob/main/Migration.md\">migration guide</a> is available if you’re updating from the\n<a class=\"extlink-pypi reference external\" href=\"https://pypi.org/project/django-template-partials/\">django-template-partials</a> third-party package.</p>\n</section>\n<section id=\"background-tasks\">\n<h3>Background Tasks<a class=\"heading-anchor\" href=\"#background-tasks\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h3>\n<p>Django now includes a built-in Tasks framework for running code outside the\nHTTP request–response cycle. This enables offloading work, such as sending\nemails or processing data, to background workers.</p>\n<p>The framework provides task definition, validation, queuing, and result\nhandling. Django guarantees consistent behavior for creating and managing\ntasks, while the responsibility for running them continues to belong to\nexternal worker processes.</p>\n<p>Tasks are defined using the <a class=\"reference internal\" href=\"/en/dev/ref/tasks/#django.tasks.task\" title=\"django.tasks.task\"><code class=\"xref py py-func docutils literal notranslate\">task()</code></a> decorator:</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.core.mail</span> <span class=\"kn\">import</span> send_mail\n<span class=\"kn\">from</span> <span class=\"nn\">django.tasks</span> <span class=\"kn\">import</span> task\n\n\n<span class=\"nd\">@task</span>\n<span class=\"k\">def</span> <span class=\"nf\">email_users</span><span class=\"p\">(</span>emails<span class=\"p\">,</span> subject<span class=\"p\">,</span> message<span class=\"p\">):</span>\n    <span class=\"k\">return</span> send_mail<span class=\"p\">(</span>subject<span class=\"p\">,</span> message<span class=\"p\">,</span> <span class=\"kc\">None</span><span class=\"p\">,</span> emails<span class=\"p\">)</span>\n</code></pre></div>\n<p>Once defined, tasks can be enqueued through a configured backend:</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>email_users<span class=\"o\">.</span>enqueue<span class=\"p\">(</span>\n    emails<span class=\"o\">=</span><span class=\"p\">[</span><span class=\"s2\">&quot;user@example.com&quot;</span><span class=\"p\">],</span>\n    subject<span class=\"o\">=</span><span class=\"s2\">&quot;You have a message&quot;</span><span class=\"p\">,</span>\n    message<span class=\"o\">=</span><span class=\"s2\">&quot;Hello there!&quot;</span><span class=\"p\">,</span>\n<span class=\"p\">)</span>\n</code></pre></div>\n<p>Backends are configured via the <a class=\"reference internal\" href=\"/en/dev/ref/settings/#std-setting-TASKS\"><code class=\"xref std std-setting docutils literal notranslate\">TASKS</code></a> setting. The <a class=\"reference internal\" href=\"/en/dev/ref/tasks/#task-available-backends\"><span class=\"std std-ref\">two\nbuilt-in backends</span></a> included in this release are\nprimarily intended for development and testing.</p>\n<p>Django handles task creation and queuing, but does not provide a worker\nmechanism to run tasks. Execution must be managed by external infrastructure,\nsuch as a separate process or service.</p>\n<p>See <a class=\"reference internal\" href=\"/en/dev/topics/tasks/\"><span class=\"doc\">Django’s Tasks framework</span></a> for an overview and the <a class=\"reference internal\" href=\"/en/dev/ref/tasks/\"><span class=\"doc\">Tasks reference</span></a> for API details.</p>\n</section>\n<section id=\"adoption-of-python-s-modern-email-api\">\n<h3>Adoption of Python’s modern email API<a class=\"heading-anchor\" href=\"#adoption-of-python-s-modern-email-api\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h3>\n<p>Email handling in Django now uses Python’s modern email API, introduced in\nPython 3.6. This API, centered around the\n<a class=\"reference external\" href=\"https://docs.python.org/3/library/email.message.html#email.message.EmailMessage\" title=\"(in Python v3.14)\"><code class=\"xref py py-class docutils literal notranslate\">email.message.EmailMessage</code></a> class, offers a cleaner and\nUnicode-friendly interface for composing and sending emails. It replaces use of\nPython’s older legacy (<code class=\"docutils literal notranslate\">Compat32</code>) API, which relied on lower-level MIME\nclasses (from <a class=\"reference external\" href=\"https://docs.python.org/3/library/email.mime.html#module-email.mime\" title=\"(in Python v3.14)\"><code class=\"xref py py-mod docutils literal notranslate\">email.mime</code></a>) and required more manual handling of\nmessage structure and encoding.</p>\n<p>Notably, the return type of the <a class=\"reference internal\" href=\"/en/dev/topics/email/#django.core.mail.EmailMessage.message\" title=\"django.core.mail.EmailMessage.message\"><code class=\"xref py py-meth docutils literal notranslate\">EmailMessage.message()</code></a> method is now an instance of Python’s\n<a class=\"reference external\" href=\"https://docs.python.org/3/library/email.message.html#email.message.EmailMessage\" title=\"(in Python v3.14)\"><code class=\"xref py py-class docutils literal notranslate\">email.message.EmailMessage</code></a>. This supports the same API as the\nprevious <code class=\"docutils literal notranslate\">SafeMIMEText</code> and <code class=\"docutils literal notranslate\">SafeMIMEMultipart</code> return types, but is not an\ninstance of those now-deprecated classes.</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 class=\"simple\">\n<li><p>The Font Awesome Free icon set (version 6.7.2) is now used for the admin\ninterface icons.</p></li>\n<li><p>The new <a class=\"reference internal\" href=\"/en/dev/ref/contrib/admin/#django.contrib.admin.AdminSite.password_change_form\" title=\"django.contrib.admin.AdminSite.password_change_form\"><code class=\"xref py py-attr docutils literal notranslate\">AdminSite.password_change_form</code></a> attribute allows customizing\nthe form used in the admin site password change view.</p></li>\n<li><p>Message levels <code class=\"docutils literal notranslate\">messages.DEBUG</code> and <code class=\"docutils literal notranslate\">messages.INFO</code> now have distinct\nicons and CSS styling. Previously, both levels shared the same appearance as\n<code class=\"docutils literal notranslate\">messages.SUCCESS</code>. Given that <a class=\"reference internal\" href=\"/en/dev/ref/contrib/admin/#django.contrib.admin.ModelAdmin.message_user\" title=\"django.contrib.admin.ModelAdmin.message_user\"><code class=\"xref py py-meth docutils literal notranslate\">ModelAdmin.message_user()</code></a> uses\n<code class=\"docutils literal notranslate\">messages.INFO</code> by default, set the level to <code class=\"docutils literal notranslate\">messages.SUCCESS</code> to keep\nthe previous icon and styling.</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\n1,000,000 to 1,200,000.</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>The new <a class=\"reference internal\" href=\"/en/dev/ref/contrib/gis/geos/#django.contrib.gis.geos.GEOSGeometry.hasm\" title=\"django.contrib.gis.geos.GEOSGeometry.hasm\"><code class=\"xref py py-attr docutils literal notranslate\">GEOSGeometry.hasm</code></a> property checks whether the geometry has\nthe M dimension.</p></li>\n<li><p>The new <a class=\"reference internal\" href=\"/en/dev/ref/contrib/gis/functions/#django.contrib.gis.db.models.functions.Rotate\" title=\"django.contrib.gis.db.models.functions.Rotate\"><code class=\"xref py py-class docutils literal notranslate\">Rotate</code></a> database\nfunction rotates a geometry by a specified angle around the origin or a\nspecified point.</p></li>\n<li><p>The new <a class=\"reference internal\" href=\"/en/dev/ref/contrib/gis/forms-api/#django.contrib.gis.forms.widgets.BaseGeometryWidget.base_layer\" title=\"django.contrib.gis.forms.widgets.BaseGeometryWidget.base_layer\"><code class=\"xref py py-attr docutils literal notranslate\">BaseGeometryWidget.base_layer</code></a> attribute allows specifying a\nJavaScript map base layer, enabling customization of map tile providers.</p></li>\n<li><p><a class=\"reference internal\" href=\"/en/dev/ref/contrib/gis/geoquerysets/#std-fieldlookup-coveredby\"><code class=\"xref std std-lookup docutils literal notranslate\">coveredby</code></a> and <a class=\"reference internal\" href=\"/en/dev/ref/contrib/gis/geoquerysets/#std-fieldlookup-isvalid\"><code class=\"xref std std-lookup docutils literal notranslate\">isvalid</code></a> lookups,\n<a class=\"reference internal\" href=\"/en/dev/ref/contrib/gis/geoquerysets/#django.contrib.gis.db.models.Collect\" title=\"django.contrib.gis.db.models.Collect\"><code class=\"xref py py-class docutils literal notranslate\">Collect</code></a> aggregation, and\n<a class=\"reference internal\" href=\"/en/dev/ref/contrib/gis/functions/#django.contrib.gis.db.models.functions.GeoHash\" title=\"django.contrib.gis.db.models.functions.GeoHash\"><code class=\"xref py py-class docutils literal notranslate\">GeoHash</code></a> and\n<a class=\"reference internal\" href=\"/en/dev/ref/contrib/gis/functions/#django.contrib.gis.db.models.functions.IsValid\" title=\"django.contrib.gis.db.models.functions.IsValid\"><code class=\"xref py py-class docutils literal notranslate\">IsValid</code></a> database functions\nare now supported on MariaDB 12.0.1+.</p></li>\n<li><p>The new <a class=\"reference internal\" href=\"/en/dev/ref/contrib/gis/geoquerysets/#std-fieldlookup-geom_type\"><code class=\"xref std std-lookup docutils literal notranslate\">geom_type</code></a> lookup and\n<a class=\"reference internal\" href=\"/en/dev/ref/contrib/gis/functions/#django.contrib.gis.db.models.functions.GeometryType\" title=\"django.contrib.gis.db.models.functions.GeometryType\"><code class=\"xref py py-class docutils literal notranslate\">GeometryType()</code></a>\ndatabase function allow filtering geometries by their types.</p></li>\n<li><p>Widgets from <a class=\"reference internal\" href=\"/en/dev/ref/contrib/gis/forms-api/#module-django.contrib.gis.forms.widgets\" title=\"django.contrib.gis.forms.widgets: GeoDjango widgets API.\"><code class=\"xref py py-mod docutils literal notranslate\">django.contrib.gis.forms.widgets</code></a> now render without\ninline JavaScript in templates. If you have customized any geometry widgets\nor their templates, you may need to <a class=\"reference internal\" href=\"/en/dev/ref/contrib/gis/forms-api/#geometry-widgets-customization\"><span class=\"std std-ref\">update them</span></a> to match the new layout.</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/search/#django.contrib.postgres.search.Lexeme\" title=\"django.contrib.postgres.search.Lexeme\"><code class=\"xref py py-class docutils literal notranslate\">Lexeme</code></a> expression\nfor full text search provides fine-grained control over search terms.\n<code class=\"docutils literal notranslate\">Lexeme</code> objects automatically escape their input and support logical\ncombination operators (<code class=\"docutils literal notranslate\">&amp;</code>, <code class=\"docutils literal notranslate\">|</code>, <code class=\"docutils literal notranslate\">~</code>), prefix matching, and term\nweighting.</p></li>\n<li><p>Model fields, indexes, and constraints from <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>\nnow include system checks to verify that <code class=\"docutils literal notranslate\">django.contrib.postgres</code> is an\ninstalled app.</p></li>\n<li><p>The <a class=\"reference internal\" href=\"/en/dev/ref/contrib/postgres/operations/#django.contrib.postgres.operations.CreateExtension\" title=\"django.contrib.postgres.operations.CreateExtension\"><code class=\"xref py py-class docutils literal notranslate\">CreateExtension</code></a>, <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>,\n<a class=\"reference internal\" href=\"/en/dev/ref/contrib/postgres/operations/#django.contrib.postgres.operations.BtreeGinExtension\" title=\"django.contrib.postgres.operations.BtreeGinExtension\"><code class=\"xref py py-class docutils literal notranslate\">BtreeGinExtension</code></a>, <a class=\"reference internal\" href=\"/en/dev/ref/contrib/postgres/operations/#django.contrib.postgres.operations.BtreeGistExtension\" title=\"django.contrib.postgres.operations.BtreeGistExtension\"><code class=\"xref py py-class docutils literal notranslate\">BtreeGistExtension</code></a>,\n<a class=\"reference internal\" href=\"/en/dev/ref/contrib/postgres/operations/#django.contrib.postgres.operations.CITextExtension\" title=\"django.contrib.postgres.operations.CITextExtension\"><code class=\"xref py py-class docutils literal notranslate\">CITextExtension</code></a>, <a class=\"reference internal\" href=\"/en/dev/ref/contrib/postgres/operations/#django.contrib.postgres.operations.CryptoExtension\" title=\"django.contrib.postgres.operations.CryptoExtension\"><code class=\"xref py py-class docutils literal notranslate\">CryptoExtension</code></a>,\n<a class=\"reference internal\" href=\"/en/dev/ref/contrib/postgres/operations/#django.contrib.postgres.operations.HStoreExtension\" title=\"django.contrib.postgres.operations.HStoreExtension\"><code class=\"xref py py-class docutils literal notranslate\">HStoreExtension</code></a>, <a class=\"reference internal\" href=\"/en/dev/ref/contrib/postgres/operations/#django.contrib.postgres.operations.TrigramExtension\" title=\"django.contrib.postgres.operations.TrigramExtension\"><code class=\"xref py py-class docutils literal notranslate\">TrigramExtension</code></a>, and\n<a class=\"reference internal\" href=\"/en/dev/ref/contrib/postgres/operations/#django.contrib.postgres.operations.UnaccentExtension\" title=\"django.contrib.postgres.operations.UnaccentExtension\"><code class=\"xref py py-class docutils literal notranslate\">UnaccentExtension</code></a> operations now support the optional <code class=\"docutils literal notranslate\">hints</code>\nparameter. This allows providing database hints to database routers to assist\nthem in <a class=\"reference internal\" href=\"/en/dev/topics/db/multi-db/#topics-db-multi-db-hints\"><span class=\"std std-ref\">making routing decisions</span></a>.</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><a class=\"reference internal\" href=\"/en/dev/ref/contrib/staticfiles/#django.contrib.staticfiles.storage.ManifestStaticFilesStorage\" title=\"django.contrib.staticfiles.storage.ManifestStaticFilesStorage\"><code class=\"xref py py-class docutils literal notranslate\">ManifestStaticFilesStorage</code></a> now\nensures consistent path ordering in manifest files, making them more\nreproducible and reducing unnecessary diffs.</p></li>\n<li><p>The <a class=\"reference internal\" href=\"/en/dev/ref/contrib/staticfiles/#django-admin-collectstatic\"><code class=\"xref std std-djadmin docutils literal notranslate\">collectstatic</code></a> command now reports only a summary for skipped\nfiles (and for deleted files when using <code class=\"docutils literal notranslate\">--clear</code>) at <code class=\"docutils literal notranslate\">--verbosity</code> 1. To\nsee per-file details for either case, set <code class=\"docutils literal notranslate\">--verbosity</code> to 2 or higher.</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 new <code class=\"docutils literal notranslate\">policy</code> argument for <a class=\"reference internal\" href=\"/en/dev/topics/email/#django.core.mail.EmailMessage.message\" title=\"django.core.mail.EmailMessage.message\"><code class=\"xref py py-meth docutils literal notranslate\">EmailMessage.message()</code></a> allows specifying the email policy,\nthe set of rules for updating and serializing the representation of the\nmessage. Defaults to <a class=\"reference external\" href=\"https://docs.python.org/3/library/email.policy.html#email.policy.default\" title=\"(in Python v3.14)\"><code class=\"xref py py-data docutils literal notranslate\">email.policy.default</code></a>.</p></li>\n<li><p><a class=\"reference internal\" href=\"/en/dev/topics/email/#django.core.mail.EmailMessage.attach\" title=\"django.core.mail.EmailMessage.attach\"><code class=\"xref py py-meth docutils literal notranslate\">EmailMessage.attach()</code></a> now\naccepts a <a class=\"reference external\" href=\"https://docs.python.org/3/library/email.message.html#email.message.MIMEPart\" title=\"(in Python v3.14)\"><code class=\"xref py py-class docutils literal notranslate\">MIMEPart</code></a> object from Python’s modern email\nAPI.</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>Added support and translations for the Haitian Creole language.</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 <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> and <a class=\"reference internal\" href=\"/en/dev/ref/django-admin/#django-admin-startapp\"><code class=\"xref std std-djadmin docutils literal notranslate\">startapp</code></a> commands now create the\ncustom target directory if it doesn’t exist.</p></li>\n<li><p>Common utilities, such as <code class=\"docutils literal notranslate\">django.conf.settings</code>, are now automatically\nimported to the <a class=\"reference internal\" href=\"/en/dev/ref/django-admin/#django-admin-shell\"><code class=\"xref std std-djadmin docutils literal notranslate\">shell</code></a> by default.</p></li>\n</ul>\n</section>\n<section id=\"migrations\">\n<h4>Migrations<a class=\"heading-anchor\" href=\"#migrations\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h4>\n<ul class=\"simple\">\n<li><p>Squashed migrations can now themselves be squashed before being transitioned\nto normal migrations.</p></li>\n<li><p>Migrations now support serialization of <a class=\"reference external\" href=\"https://docs.python.org/3/library/zoneinfo.html#zoneinfo.ZoneInfo\" title=\"(in Python v3.14)\"><code class=\"xref py py-class docutils literal notranslate\">zoneinfo.ZoneInfo</code></a> instances.</p></li>\n<li><p>Serialization of deconstructible objects now supports keyword arguments with\nnames that are not valid Python identifiers.</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><a class=\"reference internal\" href=\"/en/dev/ref/models/constraints/\"><span class=\"doc\">Constraints</span></a> now implement a <code class=\"docutils literal notranslate\">check()</code>\nmethod that is already registered with the check framework.</p></li>\n<li><p>The new <code class=\"docutils literal notranslate\">order_by</code> argument for <a class=\"reference internal\" href=\"/en/dev/ref/models/expressions/#django.db.models.Aggregate\" title=\"django.db.models.Aggregate\"><code class=\"xref py py-class docutils literal notranslate\">Aggregate</code></a> allows\nspecifying the ordering of the elements in the result.</p></li>\n<li><p>The new <a class=\"reference internal\" href=\"/en/dev/ref/models/expressions/#django.db.models.Aggregate.allow_order_by\" title=\"django.db.models.Aggregate.allow_order_by\"><code class=\"xref py py-attr docutils literal notranslate\">Aggregate.allow_order_by</code></a> class attribute determines whether\nthe aggregate function allows passing an <code class=\"docutils literal notranslate\">order_by</code> keyword argument.</p></li>\n<li><p>The new <a class=\"reference internal\" href=\"/en/dev/ref/models/querysets/#django.db.models.StringAgg\" title=\"django.db.models.StringAgg\"><code class=\"xref py py-class docutils literal notranslate\">StringAgg</code></a> aggregate returns the input\nvalues concatenated into a string, separated by the <code class=\"docutils literal notranslate\">delimiter</code> string.\nThis aggregate was previously supported only for PostgreSQL.</p></li>\n<li><p>The <a class=\"reference internal\" href=\"/en/dev/ref/models/instances/#django.db.models.Model.save\" title=\"django.db.models.Model.save\"><code class=\"xref py py-meth docutils literal notranslate\">save()</code></a> method now raises a specialized\n<a class=\"reference internal\" href=\"/en/dev/ref/models/class/#django.db.models.Model.NotUpdated\" title=\"django.db.models.Model.NotUpdated\"><code class=\"xref py py-exc docutils literal notranslate\">Model.NotUpdated</code></a> exception, when\n<a class=\"reference internal\" href=\"/en/dev/ref/models/instances/#ref-models-force-insert\"><span class=\"std std-ref\">a forced update</span></a> results in no affected rows,\ninstead of a generic <a class=\"reference internal\" href=\"/en/dev/ref/exceptions/#django.db.DatabaseError\" title=\"django.db.DatabaseError\"><code class=\"xref py py-exc docutils literal notranslate\">django.db.DatabaseError</code></a>.</p></li>\n<li><p><a class=\"reference internal\" href=\"/en/dev/ref/models/querysets/#django.db.models.query.QuerySet.raw\" title=\"django.db.models.query.QuerySet.raw\"><code class=\"xref py py-meth docutils literal notranslate\">QuerySet.raw()</code></a> now supports models with a\n<a class=\"reference internal\" href=\"/en/dev/ref/models/fields/#django.db.models.CompositePrimaryKey\" title=\"django.db.models.CompositePrimaryKey\"><code class=\"xref py py-class docutils literal notranslate\">CompositePrimaryKey</code></a>.</p></li>\n<li><p>Subqueries returning a <a class=\"reference internal\" href=\"/en/dev/ref/models/fields/#django.db.models.CompositePrimaryKey\" title=\"django.db.models.CompositePrimaryKey\"><code class=\"xref py py-class docutils literal notranslate\">CompositePrimaryKey</code></a> can now\nbe used as the target of lookups other than <code class=\"docutils literal notranslate\">__in</code>, such as <code class=\"docutils literal notranslate\">__exact</code>.</p></li>\n<li><p><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\">JSONField</code></a> now supports\n<a class=\"reference internal\" href=\"/en/dev/topics/db/queries/#key-index-and-path-transforms\"><span class=\"std std-ref\">negative array indexing</span></a> on SQLite.</p></li>\n<li><p>The new <a class=\"reference internal\" href=\"/en/dev/ref/models/querysets/#django.db.models.AnyValue\" title=\"django.db.models.AnyValue\"><code class=\"xref py py-class docutils literal notranslate\">AnyValue</code></a> aggregate returns an arbitrary\nvalue from the non-null input values. This is supported on SQLite, MySQL,\nOracle, and PostgreSQL 16+.</p></li>\n<li><p><a class=\"reference internal\" href=\"/en/dev/ref/models/fields/#django.db.models.GeneratedField\" title=\"django.db.models.GeneratedField\"><code class=\"xref py py-class docutils literal notranslate\">GeneratedField</code></a>s and <a class=\"reference internal\" href=\"/en/dev/ref/models/expressions/#avoiding-race-conditions-using-f\"><span class=\"std std-ref\">fields assigned\nexpressions</span></a> are now refreshed from the\ndatabase after <a class=\"reference internal\" href=\"/en/dev/ref/models/instances/#django.db.models.Model.save\" title=\"django.db.models.Model.save\"><code class=\"xref py py-meth docutils literal notranslate\">save()</code></a> on backends that support\nthe <code class=\"docutils literal notranslate\">RETURNING</code> clause (SQLite, PostgreSQL, and Oracle). On backends that\ndon’t support it (MySQL and MariaDB), the fields are marked as deferred to\ntrigger a refresh on subsequent accesses.</p></li>\n<li><p>Using a <a class=\"reference internal\" href=\"/en/dev/topics/composite-primary-key/#cpk-and-relations\"><span class=\"std std-ref\">ForeignObject</span></a> with multiple\n<code class=\"docutils literal notranslate\">from_fields</code> in Model indexes, constraints, or <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\">unique_together</code></a> now emits a system check error.</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>The new <a class=\"reference internal\" href=\"/en/dev/ref/paginator/#django.core.paginator.AsyncPaginator\" title=\"django.core.paginator.AsyncPaginator\"><code class=\"xref py py-class docutils literal notranslate\">AsyncPaginator</code></a> and\n<a class=\"reference internal\" href=\"/en/dev/ref/paginator/#django.core.paginator.AsyncPage\" title=\"django.core.paginator.AsyncPage\"><code class=\"xref py py-class docutils literal notranslate\">AsyncPage</code></a> provide async implementations of\n<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> and\n<a class=\"reference internal\" href=\"/en/dev/ref/paginator/#django.core.paginator.Page\" title=\"django.core.paginator.Page\"><code class=\"xref py py-class docutils literal notranslate\">Page</code></a> respectively.</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>Multiple <code class=\"docutils literal notranslate\">Cookie</code> headers are now supported for HTTP/2 requests when\nrunning with ASGI.</p></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 new variable <code class=\"docutils literal notranslate\">forloop.length</code> is now available within a <a class=\"reference internal\" href=\"/en/dev/ref/templates/builtins/#std-templatetag-for\"><code class=\"xref std std-ttag docutils literal notranslate\">for</code></a>\nloop.</p></li>\n<li><p>The <a class=\"reference internal\" href=\"/en/dev/ref/templates/builtins/#std-templatetag-querystring\"><code class=\"xref std std-ttag docutils literal notranslate\">querystring</code></a> template tag now consistently prefixes the returned\nquery string with a <code class=\"docutils literal notranslate\">?</code>, ensuring reliable link generation behavior.</p></li>\n<li><p>The <a class=\"reference internal\" href=\"/en/dev/ref/templates/builtins/#std-templatetag-querystring\"><code class=\"xref std std-ttag docutils literal notranslate\">querystring</code></a> template tag now accepts multiple positional\narguments, which must be mappings, such as <a class=\"reference internal\" href=\"/en/dev/ref/request-response/#django.http.QueryDict\" title=\"django.http.QueryDict\"><code class=\"xref py py-class docutils literal notranslate\">QueryDict</code></a>\nor <a class=\"reference external\" href=\"https://docs.python.org/3/library/stdtypes.html#dict\" title=\"(in Python v3.14)\"><code class=\"xref py py-class docutils literal notranslate\">dict</code></a>.</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>The <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 supports parallel test execution on systems\nusing the <code class=\"docutils literal notranslate\">forkserver</code> <a class=\"reference external\" href=\"https://docs.python.org/3/library/multiprocessing.html#module-multiprocessing\" title=\"(in Python v3.14)\"><code class=\"xref py py-mod docutils literal notranslate\">multiprocessing</code></a> start method.</p></li>\n</ul>\n</section>\n</section>\n</section>\n<section id=\"backwards-incompatible-changes-in-6-0\">\n<span id=\"backwards-incompatible-6-0\"></span><h2>Backwards incompatible changes in 6.0<a class=\"heading-anchor\" href=\"#backwards-incompatible-changes-in-6-0\"><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><a class=\"reference internal\" href=\"/en/dev/ref/schema-editor/#django.db.backends.base.schema.BaseDatabaseSchemaEditor\" title=\"django.db.backends.base.schema.BaseDatabaseSchemaEditor\"><code class=\"xref py py-class docutils literal notranslate\">BaseDatabaseSchemaEditor</code></a> and\nPostgreSQL backends no longer use <code class=\"docutils literal notranslate\">CASCADE</code> when dropping a column.</p></li>\n<li><p><code class=\"docutils literal notranslate\">DatabaseOperations.return_insert_columns()</code> and\n<code class=\"docutils literal notranslate\">DatabaseOperations.fetch_returned_insert_rows()</code> methods are renamed to\n<code class=\"docutils literal notranslate\">returning_columns()</code> and <code class=\"docutils literal notranslate\">fetch_returned_rows()</code>, respectively, to\ndenote they can be used in the context of <code class=\"docutils literal notranslate\">UPDATE … RETURNING</code> statements\nas well as <code class=\"docutils literal notranslate\">INSERT … RETURNING</code>.</p></li>\n<li><p>The <code class=\"docutils literal notranslate\">DatabaseOperations.fetch_returned_insert_columns()</code> method is removed\nand the <code class=\"docutils literal notranslate\">fetch_returned_rows()</code> method replacing\n<code class=\"docutils literal notranslate\">fetch_returned_insert_rows()</code> expects both a <code class=\"docutils literal notranslate\">cursor</code> and\n<code class=\"docutils literal notranslate\">returning_params</code> to be provided, just like\n<code class=\"docutils literal notranslate\">fetch_returned_insert_columns()</code> did.</p></li>\n<li><p>If the database supports <code class=\"docutils literal notranslate\">UPDATE … RETURNING</code> statements, backends can set\n<code class=\"docutils literal notranslate\">DatabaseFeatures.can_return_rows_from_update=True</code>.</p></li>\n</ul>\n</section>\n<section id=\"dropped-support-for-mariadb-10-5\">\n<h3>Dropped support for MariaDB 10.5<a class=\"heading-anchor\" href=\"#dropped-support-for-mariadb-10-5\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h3>\n<p>Upstream support for MariaDB 10.5 ends in June 2025. Django 6.0 supports\nMariaDB 10.6 and higher.</p>\n</section>\n<section id=\"dropped-support-for-python-3-12\">\n<h3>Dropped support for Python &lt; 3.12<a class=\"heading-anchor\" href=\"#dropped-support-for-python-3-12\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h3>\n<p>Because Python 3.12 is now the minimum supported version for Django, any\noptional dependencies must also meet that requirement. The following versions\nof each library are the first to add or confirm compatibility with Python 3.12:</p>\n<ul class=\"simple\">\n<li><p><code class=\"docutils literal notranslate\">aiosmtpd</code> 1.4.5</p></li>\n<li><p><code class=\"docutils literal notranslate\">argon2-cffi</code> 23.1.0</p></li>\n<li><p><code class=\"docutils literal notranslate\">bcrypt</code> 4.1.1</p></li>\n<li><p><code class=\"docutils literal notranslate\">docutils</code> 0.22</p></li>\n<li><p><code class=\"docutils literal notranslate\">geoip2</code> 4.8.0</p></li>\n<li><p><code class=\"docutils literal notranslate\">Pillow</code> 10.1.0</p></li>\n<li><p><code class=\"docutils literal notranslate\">mysqlclient</code> 2.2.1</p></li>\n<li><p><code class=\"docutils literal notranslate\">numpy</code> 1.26.0</p></li>\n<li><p><code class=\"docutils literal notranslate\">PyYAML</code> 6.0.2</p></li>\n<li><p><code class=\"docutils literal notranslate\">psycopg</code> 3.1.12</p></li>\n<li><p><code class=\"docutils literal notranslate\">psycopg2</code> 2.9.9</p></li>\n<li><p><code class=\"docutils literal notranslate\">redis-py</code> 5.1.0</p></li>\n<li><p><code class=\"docutils literal notranslate\">selenium</code> 4.23.0</p></li>\n<li><p><code class=\"docutils literal notranslate\">sqlparse</code> 0.5.0</p></li>\n<li><p><code class=\"docutils literal notranslate\">tblib</code> 3.0.0</p></li>\n</ul>\n</section>\n<section id=\"id1\">\n<h3>Email<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 undocumented <code class=\"docutils literal notranslate\">mixed_subtype</code> and <code class=\"docutils literal notranslate\">alternative_subtype</code> properties\nof <a class=\"reference internal\" href=\"/en/dev/topics/email/#django.core.mail.EmailMessage\" title=\"django.core.mail.EmailMessage\"><code class=\"xref py py-class docutils literal notranslate\">EmailMessage</code></a> and\n<a class=\"reference internal\" href=\"/en/dev/topics/email/#django.core.mail.EmailMultiAlternatives\" title=\"django.core.mail.EmailMultiAlternatives\"><code class=\"xref py py-class docutils literal notranslate\">EmailMultiAlternatives</code></a> are no longer supported.</p></li>\n<li><p>The undocumented <code class=\"docutils literal notranslate\">encoding</code> property of\n<a class=\"reference internal\" href=\"/en/dev/topics/email/#django.core.mail.EmailMessage\" title=\"django.core.mail.EmailMessage\"><code class=\"xref py py-class docutils literal notranslate\">EmailMessage</code></a> no longer supports Python legacy\n<a class=\"reference external\" href=\"https://docs.python.org/3/library/email.charset.html#email.charset.Charset\" title=\"(in Python v3.14)\"><code class=\"xref py py-class docutils literal notranslate\">email.charset.Charset</code></a> objects.</p></li>\n<li><p>As the internal implementations of <a class=\"reference internal\" href=\"/en/dev/topics/email/#django.core.mail.EmailMessage\" title=\"django.core.mail.EmailMessage\"><code class=\"xref py py-class docutils literal notranslate\">EmailMessage</code></a>\nand <a class=\"reference internal\" href=\"/en/dev/topics/email/#django.core.mail.EmailMultiAlternatives\" title=\"django.core.mail.EmailMultiAlternatives\"><code class=\"xref py py-class docutils literal notranslate\">EmailMultiAlternatives</code></a> have changed\nsignificantly, closely examine any custom subclasses that rely on overriding\nundocumented, internal underscore methods.</p></li>\n</ul>\n</section>\n<section id=\"default-auto-field-setting-now-defaults-to-bigautofield\">\n<h3><code class=\"docutils literal notranslate\">DEFAULT_AUTO_FIELD</code> setting now defaults to <code class=\"docutils literal notranslate\">BigAutoField</code><a class=\"heading-anchor\" href=\"#default-auto-field-setting-now-defaults-to-bigautofield\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h3>\n<p>Since Django 3.2, when the <a class=\"reference internal\" href=\"/en/dev/ref/settings/#std-setting-DEFAULT_AUTO_FIELD\"><code class=\"xref std std-setting docutils literal notranslate\">DEFAULT_AUTO_FIELD</code></a> setting was added,\nthe default <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> template’s <code class=\"docutils literal notranslate\">settings.py</code> contained:</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>DEFAULT_AUTO_FIELD <span class=\"o\">=</span> <span class=\"s2\">&quot;django.db.models.BigAutoField&quot;</span>\n</code></pre></div>\n<p>and the default <a class=\"reference internal\" href=\"/en/dev/ref/django-admin/#django-admin-startapp\"><code class=\"xref std std-djadmin docutils literal notranslate\">startapp</code></a> template’s <code class=\"docutils literal notranslate\">AppConfig</code> contained:</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>default_auto_field <span class=\"o\">=</span> <span class=\"s2\">&quot;django.db.models.BigAutoField&quot;</span>\n</code></pre></div>\n<p>At that time, the default value of <a class=\"reference internal\" href=\"/en/dev/ref/settings/#std-setting-DEFAULT_AUTO_FIELD\"><code class=\"xref std std-setting docutils literal notranslate\">DEFAULT_AUTO_FIELD</code></a> remained\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\">django.db.models.AutoField</code></a> for backwards compatibility.</p>\n<p>In Django 6.0, <a class=\"reference internal\" href=\"/en/dev/ref/settings/#std-setting-DEFAULT_AUTO_FIELD\"><code class=\"xref std std-setting docutils literal notranslate\">DEFAULT_AUTO_FIELD</code></a> now defaults to\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\">django.db.models.BigAutoField</code></a> and the aforementioned lines in the\nproject and app templates are removed.</p>\n<p>Most projects shouldn’t be affected, since Django 3.2 has raised the system\ncheck warning <strong>models.W042</strong> for projects that don’t set\n<a class=\"reference internal\" href=\"/en/dev/ref/settings/#std-setting-DEFAULT_AUTO_FIELD\"><code class=\"xref std std-setting docutils literal notranslate\">DEFAULT_AUTO_FIELD</code></a>.</p>\n<p>If you haven’t dealt with this warning by now, add\n<code class=\"docutils literal notranslate\">DEFAULT_AUTO_FIELD = 'django.db.models.AutoField'</code> to your project’s\nsettings, or <code class=\"docutils literal notranslate\">default_auto_field = 'django.db.models.AutoField'</code> to an app’s\n<code class=\"docutils literal notranslate\">AppConfig</code>, as needed.</p>\n</section>\n<section id=\"custom-orm-expressions-should-return-params-as-a-tuple\">\n<span id=\"tuple-for-params\"></span><h3>Custom ORM expressions should return params as a tuple<a class=\"heading-anchor\" href=\"#custom-orm-expressions-should-return-params-as-a-tuple\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h3>\n<p>Prior to Django 6.0, <a class=\"reference internal\" href=\"/en/dev/howto/custom-lookups/\"><span class=\"doc\">custom lookups</span></a> and\n<a class=\"reference internal\" href=\"/en/dev/ref/models/expressions/#writing-your-own-query-expressions\"><span class=\"std std-ref\">custom expressions</span></a> implementing the\n<code class=\"docutils literal notranslate\">as_sql()</code> method (and its supporting methods <code class=\"docutils literal notranslate\">process_lhs()</code> and\n<code class=\"docutils literal notranslate\">process_rhs()</code>) were allowed to return a sequence of params in either a list\nor a tuple. To address the interoperability problems that resulted, the second\nreturn element of the <code class=\"docutils literal notranslate\">as_sql()</code> method should now be a tuple:</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\">def</span> <span class=\"nf\">as_sql</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"p\">,</span> compiler<span class=\"p\">,</span> connection<span class=\"p\">)</span> <span class=\"o\">-&gt;</span> <span class=\"nb\">tuple</span><span class=\"p\">[</span><span class=\"nb\">str</span><span class=\"p\">,</span> <span class=\"nb\">tuple</span><span class=\"p\">]:</span> <span class=\"o\">...</span>\n</code></pre></div>\n<p>If your custom expressions support multiple versions of Django, you should\nadjust any pre-processing of parameters to be resilient against either tuples\nor lists. For instance, prefer unpacking like this:</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>params <span class=\"o\">=</span> <span class=\"p\">(</span><span class=\"o\">*</span>lhs_params<span class=\"p\">,</span> <span class=\"o\">*</span>rhs_params<span class=\"p\">)</span>\n</code></pre></div>\n</section>\n<section id=\"miscellaneous\">\n<h3>Miscellaneous<a class=\"heading-anchor\" href=\"#miscellaneous\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h3>\n<ul class=\"simple\">\n<li><p>The <a class=\"reference internal\" href=\"/en/dev/topics/serialization/#serialization-formats-json\"><span class=\"std std-ref\">JSON</span></a> serializer now writes a newline\nat the end of the output, even without the <code class=\"docutils literal notranslate\">indent</code> option set.</p></li>\n<li><p>The minimum supported version of <code class=\"docutils literal notranslate\">asgiref</code> is increased from 3.8.1 to\n3.9.1.</p></li>\n</ul>\n<ul class=\"simple\">\n<li><p><a class=\"reference internal\" href=\"/en/dev/ref/models/fields/#django.db.models.Field.pre_save\" title=\"django.db.models.Field.pre_save\"><code class=\"xref py py-meth docutils literal notranslate\">Field.pre_save()</code></a> may now be called more than once when saving model\ninstances, so custom implementations should be idempotent and free of side\neffects.</p></li>\n</ul>\n</section>\n</section>\n<section id=\"features-deprecated-in-6-0\">\n<span id=\"deprecated-features-6-0\"></span><h2>Features deprecated in 6.0<a class=\"heading-anchor\" href=\"#features-deprecated-in-6-0\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h2>\n<section id=\"positional-arguments-in-django-core-mail-apis\">\n<h3>Positional arguments in <code class=\"docutils literal notranslate\">django.core.mail</code> APIs<a class=\"heading-anchor\" href=\"#positional-arguments-in-django-core-mail-apis\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h3>\n<p><a class=\"reference internal\" href=\"/en/dev/topics/email/#module-django.core.mail\" title=\"django.core.mail: Helpers to send email.\"><code class=\"xref py py-mod docutils literal notranslate\">django.core.mail</code></a> APIs now require keyword arguments for less commonly\nused parameters. Using positional arguments for these now emits a deprecation\nwarning and will raise a <a class=\"reference external\" href=\"https://docs.python.org/3/library/exceptions.html#TypeError\" title=\"(in Python v3.14)\"><code class=\"xref py py-exc docutils literal notranslate\">TypeError</code></a> when the deprecation period ends:</p>\n<ul class=\"simple\">\n<li><p>All <em>optional</em> parameters (<code class=\"docutils literal notranslate\">fail_silently</code> and later) must be passed as\nkeyword arguments to <a class=\"reference internal\" href=\"/en/dev/topics/email/#django.core.mail.get_connection\" title=\"django.core.mail.get_connection\"><code class=\"xref py py-func docutils literal notranslate\">get_connection()</code></a>, <a class=\"reference internal\" href=\"/en/dev/topics/email/#django.core.mail.mail_admins\" title=\"django.core.mail.mail_admins\"><code class=\"xref py py-func docutils literal notranslate\">mail_admins()</code></a>,\n<a class=\"reference internal\" href=\"/en/dev/topics/email/#django.core.mail.mail_managers\" title=\"django.core.mail.mail_managers\"><code class=\"xref py py-func docutils literal notranslate\">mail_managers()</code></a>, <a class=\"reference internal\" href=\"/en/dev/topics/email/#django.core.mail.send_mail\" title=\"django.core.mail.send_mail\"><code class=\"xref py py-func docutils literal notranslate\">send_mail()</code></a>, and <a class=\"reference internal\" href=\"/en/dev/topics/email/#django.core.mail.send_mass_mail\" title=\"django.core.mail.send_mass_mail\"><code class=\"xref py py-func docutils literal notranslate\">send_mass_mail()</code></a>.</p></li>\n<li><p>All parameters must be passed as keyword arguments when creating an\n<a class=\"reference internal\" href=\"/en/dev/topics/email/#django.core.mail.EmailMessage\" title=\"django.core.mail.EmailMessage\"><code class=\"xref py py-class docutils literal notranslate\">EmailMessage</code></a> or <a class=\"reference internal\" href=\"/en/dev/topics/email/#django.core.mail.EmailMultiAlternatives\" title=\"django.core.mail.EmailMultiAlternatives\"><code class=\"xref py py-class docutils literal notranslate\">EmailMultiAlternatives</code></a> instance, except\nfor the first four (<code class=\"docutils literal notranslate\">subject</code>, <code class=\"docutils literal notranslate\">body</code>, <code class=\"docutils literal notranslate\">from_email</code>, and <code class=\"docutils literal notranslate\">to</code>), which\nmay still be passed either as positional or keyword arguments.</p></li>\n</ul>\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 class=\"simple\">\n<li><p><code class=\"docutils literal notranslate\">BaseDatabaseCreation.create_test_db(serialize)</code> is deprecated. Use\n<code class=\"docutils literal notranslate\">serialize_db_to_string()</code> instead.</p></li>\n<li><p>The PostgreSQL <code class=\"docutils literal notranslate\">StringAgg</code> class is deprecated in favor of the generally\navailable <a class=\"reference internal\" href=\"/en/dev/ref/models/querysets/#django.db.models.StringAgg\" title=\"django.db.models.StringAgg\"><code class=\"xref py py-class docutils literal notranslate\">StringAgg</code></a> class.</p></li>\n<li><p>Passing a string to the\n<a class=\"reference internal\" href=\"/en/dev/ref/contrib/postgres/aggregates/#django.contrib.postgres.aggregates.StringAgg.delimiter\" title=\"django.contrib.postgres.aggregates.StringAgg.delimiter\"><code class=\"xref py py-attr docutils literal notranslate\">delimiter</code></a> argument of\nthe (deprecated) PostgreSQL <code class=\"docutils literal notranslate\">StringAgg</code> class is deprecated. Use a\n<a class=\"reference internal\" href=\"/en/dev/ref/models/expressions/#django.db.models.Value\" title=\"django.db.models.Value\"><code class=\"xref py py-class docutils literal notranslate\">Value</code></a> or expression instead to prepare for\ncompatibility with the generally available\n<a class=\"reference internal\" href=\"/en/dev/ref/models/querysets/#django.db.models.StringAgg\" title=\"django.db.models.StringAgg\"><code class=\"xref py py-class docutils literal notranslate\">StringAgg</code></a> class.</p></li>\n<li><p>The PostgreSQL <code class=\"docutils literal notranslate\">OrderableAggMixin</code> is deprecated in favor of the\n<code class=\"docutils literal notranslate\">order_by</code> attribute now available on the\n<a class=\"reference internal\" href=\"/en/dev/ref/models/expressions/#django.db.models.Aggregate\" title=\"django.db.models.Aggregate\"><code class=\"xref py py-class docutils literal notranslate\">Aggregate</code></a> class.</p></li>\n<li><p>The default protocol in <a class=\"reference internal\" href=\"/en/dev/ref/templates/builtins/#std-templatefilter-urlize\"><code class=\"xref std std-tfilter docutils literal notranslate\">urlize</code></a> and <a class=\"reference internal\" href=\"/en/dev/ref/templates/builtins/#std-templatefilter-urlizetrunc\"><code class=\"xref std std-tfilter docutils literal notranslate\">urlizetrunc</code></a> will\nchange from HTTP to HTTPS in Django 2028. Set the transitional setting\n<a class=\"reference internal\" href=\"/en/dev/ref/settings/#std-setting-URLIZE_ASSUME_HTTPS\"><code class=\"xref std std-setting docutils literal notranslate\">URLIZE_ASSUME_HTTPS</code></a> to <code class=\"docutils literal notranslate\">True</code> to opt into assuming HTTPS during\nthe Django 6.x release cycle.</p></li>\n<li><p>The <a class=\"reference internal\" href=\"/en/dev/ref/settings/#std-setting-URLIZE_ASSUME_HTTPS\"><code class=\"xref std std-setting docutils literal notranslate\">URLIZE_ASSUME_HTTPS</code></a> transitional setting is deprecated.</p></li>\n<li><p>Setting <a class=\"reference internal\" href=\"/en/dev/ref/settings/#std-setting-ADMINS\"><code class=\"xref std std-setting docutils literal notranslate\">ADMINS</code></a> or <a class=\"reference internal\" href=\"/en/dev/ref/settings/#std-setting-MANAGERS\"><code class=\"xref std std-setting docutils literal notranslate\">MANAGERS</code></a> to a list of (name, address)\ntuples is deprecated. Set to a list of email address strings instead. Django\nnever used the name portion. To include a name, format the address string as\n<code class=\"docutils literal notranslate\">'&quot;Name&quot; &lt;address&gt;'</code> or use Python’s <a class=\"reference external\" href=\"https://docs.python.org/3/library/email.utils.html#email.utils.formataddr\" title=\"(in Python v3.14)\"><code class=\"xref py py-func docutils literal notranslate\">email.utils.formataddr()</code></a>.</p></li>\n<li><p>Support for the <code class=\"docutils literal notranslate\">orphans</code> argument being larger than or equal to the\n<code class=\"docutils literal notranslate\">per_page</code> argument of <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\">django.core.paginator.Paginator</code></a> and\n<a class=\"reference internal\" href=\"/en/dev/ref/paginator/#django.core.paginator.AsyncPaginator\" title=\"django.core.paginator.AsyncPaginator\"><code class=\"xref py py-class docutils literal notranslate\">django.core.paginator.AsyncPaginator</code></a> is deprecated.</p></li>\n<li><p>Using a percent sign in a column alias or annotation is deprecated.</p></li>\n<li><p>Support for passing Python’s legacy email <a class=\"reference external\" href=\"https://docs.python.org/3/library/email.mime.html#email.mime.base.MIMEBase\" title=\"(in Python v3.14)\"><code class=\"xref py py-class docutils literal notranslate\">MIMEBase</code></a>\nobject to\n<a class=\"reference internal\" href=\"/en/dev/topics/email/#django.core.mail.EmailMessage.attach\" title=\"django.core.mail.EmailMessage.attach\"><code class=\"xref py py-meth docutils literal notranslate\">EmailMessage.attach()</code></a> (or\nincluding one in the message’s <code class=\"docutils literal notranslate\">attachments</code> list) is deprecated. For\ncomplex attachments requiring additional headers or parameters, switch to the\nmodern email API’s <a class=\"reference external\" href=\"https://docs.python.org/3/library/email.message.html#email.message.MIMEPart\" title=\"(in Python v3.14)\"><code class=\"xref py py-class docutils literal notranslate\">MIMEPart</code></a>.</p></li>\n<li><p>The <code class=\"docutils literal notranslate\">django.core.mail.BadHeaderError</code> exception is deprecated. Python’s\nmodern email raises a <code class=\"xref py py-exc docutils literal notranslate\">ValueError</code> for email headers containing\nprohibited characters.</p></li>\n<li><p>The <code class=\"docutils literal notranslate\">django.core.mail.SafeMIMEText</code> and <code class=\"docutils literal notranslate\">SafeMIMEMultipart</code> classes are\ndeprecated.</p></li>\n<li><p>The undocumented <code class=\"docutils literal notranslate\">django.core.mail.forbid_multi_line_headers()</code> and\n<code class=\"docutils literal notranslate\">django.core.mail.message.sanitize_address()</code> functions are deprecated.</p></li>\n</ul>\n</section>\n</section>\n<section id=\"features-removed-in-6-0\">\n<h2>Features removed in 6.0<a class=\"heading-anchor\" href=\"#features-removed-in-6-0\"><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 6.0.</p>\n<p>See <a class=\"reference internal\" href=\"/en/dev/releases/5.0/#deprecated-features-5-0\"><span class=\"std std-ref\">Features deprecated in 5.0</span></a> for details on these changes, including how\nto remove usage of these features.</p>\n<ul class=\"simple\">\n<li><p>Support for passing positional arguments to <code class=\"docutils literal notranslate\">BaseConstraint</code> is removed.</p></li>\n<li><p>The <code class=\"docutils literal notranslate\">DjangoDivFormRenderer</code> and <code class=\"docutils literal notranslate\">Jinja2DivFormRenderer</code> transitional form\nrenderers are removed.</p></li>\n<li><p><code class=\"docutils literal notranslate\">BaseDatabaseOperations.field_cast_sql()</code> is removed.</p></li>\n<li><p><code class=\"docutils literal notranslate\">request</code> is required in the signature of <code class=\"docutils literal notranslate\">ModelAdmin.lookup_allowed()</code>\nsubclasses.</p></li>\n<li><p>Support for calling <code class=\"docutils literal notranslate\">format_html()</code> without passing args or kwargs is\nremoved.</p></li>\n<li><p>The default scheme for <code class=\"docutils literal notranslate\">forms.URLField</code> has changed from <code class=\"docutils literal notranslate\">&quot;http&quot;</code> to\n<code class=\"docutils literal notranslate\">&quot;https&quot;</code>.</p></li>\n<li><p>The <code class=\"docutils literal notranslate\">FORMS_URLFIELD_ASSUME_HTTPS</code> transitional setting is removed.</p></li>\n<li><p>The <code class=\"docutils literal notranslate\">django.db.models.sql.datastructures.Join</code> no longer falls back to\n<code class=\"docutils literal notranslate\">get_joining_columns()</code>.</p></li>\n<li><p>The <code class=\"docutils literal notranslate\">get_joining_columns()</code> method of <code class=\"docutils literal notranslate\">ForeignObject</code> and\n<code class=\"docutils literal notranslate\">ForeignObjectRel</code> is removed.</p></li>\n<li><p>The <code class=\"docutils literal notranslate\">ForeignObject.get_reverse_joining_columns()</code> method is removed.</p></li>\n<li><p>Support for <code class=\"docutils literal notranslate\">cx_Oracle</code> is removed.</p></li>\n<li><p>The <code class=\"docutils literal notranslate\">ChoicesMeta</code> alias to <code class=\"docutils literal notranslate\">django.db.models.enums.ChoicesType</code> is\nremoved.</p></li>\n<li><p>The <code class=\"docutils literal notranslate\">Prefetch.get_current_queryset()</code> method is removed.</p></li>\n<li><p>The <code class=\"docutils literal notranslate\">get_prefetch_queryset()</code> method of related managers and descriptors is\nremoved.</p></li>\n<li><p><code class=\"docutils literal notranslate\">get_prefetcher()</code> and <code class=\"docutils literal notranslate\">prefetch_related_objects()</code> no longer fall back\nto <code class=\"docutils literal notranslate\">get_prefetch_queryset()</code>.</p></li>\n</ul>\n<p>See <a class=\"reference internal\" href=\"/en/dev/releases/5.1/#deprecated-features-5-1\"><span class=\"std std-ref\">Features deprecated in 5.1</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.urls.register_converter()</code> no longer allows overriding existing\nconverters.</p></li>\n<li><p>The <code class=\"docutils literal notranslate\">ModelAdmin.log_deletion()</code> and <code class=\"docutils literal notranslate\">LogEntryManager.log_action()</code>\nmethods are removed.</p></li>\n<li><p>The undocumented <code class=\"docutils literal notranslate\">django.utils.itercompat.is_iterable()</code> function and the\n<code class=\"docutils literal notranslate\">django.utils.itercompat</code> module are removed.</p></li>\n<li><p>The <code class=\"docutils literal notranslate\">django.contrib.gis.geoip2.GeoIP2.coords()</code> method is removed.</p></li>\n<li><p>The <code class=\"docutils literal notranslate\">django.contrib.gis.geoip2.GeoIP2.open()</code> method is removed.</p></li>\n<li><p>Support for passing positional arguments to <code class=\"docutils literal notranslate\">Model.save()</code> and\n<code class=\"docutils literal notranslate\">Model.asave()</code> is removed.</p></li>\n<li><p>The setter for <code class=\"docutils literal notranslate\">django.contrib.gis.gdal.OGRGeometry.coord_dim</code> is removed.</p></li>\n<li><p>The <code class=\"docutils literal notranslate\">check</code> keyword argument of <code class=\"docutils literal notranslate\">CheckConstraint</code> is removed.</p></li>\n<li><p>The <code class=\"docutils literal notranslate\">get_cache_name()</code> method of <code class=\"docutils literal notranslate\">FieldCacheMixin</code> is removed.</p></li>\n<li><p>The <code class=\"docutils literal notranslate\">OS_OPEN_FLAGS</code> attribute of\n<a class=\"reference internal\" href=\"/en/dev/ref/files/storage/#django.core.files.storage.FileSystemStorage\" title=\"django.core.files.storage.FileSystemStorage\"><code class=\"xref py py-class docutils literal notranslate\">FileSystemStorage</code></a> is removed.</p></li>\n</ul>\n</section>","rootId":"django-6-0-release-notes","toc":[{"title":"Python compatibility","anchor":"python-compatibility","children":[]},{"title":"Third-party library support for older versions of Django","anchor":"third-party-library-support-for-older-versions-of-django","children":[]},{"title":"What’s new in Django 6.0","anchor":"what-s-new-in-django-6-0","children":[{"title":"Content Security Policy support","anchor":"content-security-policy-support","children":[]},{"title":"Template Partials","anchor":"template-partials","children":[]},{"title":"Background Tasks","anchor":"background-tasks","children":[]},{"title":"Adoption of Python’s modern email API","anchor":"adoption-of-python-s-modern-email-api","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.gis","anchor":"django-contrib-gis","children":[]},{"title":"django.contrib.postgres","anchor":"django-contrib-postgres","children":[]},{"title":"django.contrib.staticfiles","anchor":"django-contrib-staticfiles","children":[]},{"title":"Email","anchor":"email","children":[]},{"title":"Internationalization","anchor":"internationalization","children":[]},{"title":"Management Commands","anchor":"management-commands","children":[]},{"title":"Migrations","anchor":"migrations","children":[]},{"title":"Models","anchor":"models","children":[]},{"title":"Pagination","anchor":"pagination","children":[]},{"title":"Requests and Responses","anchor":"requests-and-responses","children":[]},{"title":"Templates","anchor":"templates","children":[]},{"title":"Tests","anchor":"tests","children":[]}]}]},{"title":"Backwards incompatible changes in 6.0","anchor":"backwards-incompatible-changes-in-6-0","children":[{"title":"Database backend API","anchor":"database-backend-api","children":[]},{"title":"Dropped support for MariaDB 10.5","anchor":"dropped-support-for-mariadb-10-5","children":[]},{"title":"Dropped support for Python < 3.12","anchor":"dropped-support-for-python-3-12","children":[]},{"title":"Email","anchor":"id1","children":[]},{"title":"DEFAULT_AUTO_FIELD setting now defaults to BigAutoField","anchor":"default-auto-field-setting-now-defaults-to-bigautofield","children":[]},{"title":"Custom ORM expressions should return params as a tuple","anchor":"custom-orm-expressions-should-return-params-as-a-tuple","children":[]},{"title":"Miscellaneous","anchor":"miscellaneous","children":[]}]},{"title":"Features deprecated in 6.0","anchor":"features-deprecated-in-6-0","children":[{"title":"Positional arguments in django.core.mail APIs","anchor":"positional-arguments-in-django-core-mail-apis","children":[]},{"title":"Miscellaneous","anchor":"id2","children":[]}]},{"title":"Features removed in 6.0","anchor":"features-removed-in-6-0","children":[]}],"breadcrumbs":[{"docname":"releases/index","title":"Release notes","url":"/en/dev/releases/"}],"prev":{"docname":"releases/6.0.1","title":"Django 6.0.1 release notes","url":"/en/dev/releases/6.0.1/"},"next":{"docname":"releases/5.2.18","title":"Django 5.2.18 release notes","url":"/en/dev/releases/5.2.18/"},"formats":{"html":"/en/dev/releases/6.0/","markdown":"/en/dev/releases/6.0.md","json":"/en/dev/releases/6.0.json"},"source":"https://github.com/django/django/blob/main/docs/releases/6.0.txt","official":"https://docs.djangoproject.com/en/dev/releases/6.0/","inVersions":["dev","6.1","6.0"],"inLocales":["en"]}