{"title":"Django 6.2 release notes - UNDER DEVELOPMENT","version":"dev","locale":"en","docname":"releases/6.2","url":"/en/dev/releases/6.2/","canonical":"https://djangodocs.dev/en/dev/releases/6.2/","summary":"Welcome to Django 6.2! 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.2 release notes - UNDER DEVELOPMENT<a class=\"heading-anchor\" href=\"#django-6-2-release-notes-under-development\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h1>\n<p><em>Expected April 2027</em></p>\n<p>Welcome to Django 6.2!</p>\n<p>These release notes cover the <a class=\"reference internal\" href=\"#whats-new-6-2\"><span class=\"std std-ref\">new features</span></a>, as well as\nsome <a class=\"reference internal\" href=\"#backwards-incompatible-6-2\"><span class=\"std std-ref\">backwards incompatible changes</span></a> you\nshould be aware of when upgrading from Django 6.1 or earlier. We’ve\n<a class=\"reference internal\" href=\"#deprecated-features-6-2\"><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<p>Django 6.2 is designated as a <a class=\"reference internal\" href=\"/en/dev/internals/release-process/#term-Long-term-support-release\"><span class=\"xref std std-term\">long-term support release</span></a>. It will receive security updates for at least\nthree years after its release. Support for the previous LTS, Django 5.2, will\nend in April 2028.</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.2 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</section>\n<section id=\"what-s-new-in-django-6-2\">\n<span id=\"whats-new-6-2\"></span><h2>What’s new in Django 6.2<a class=\"heading-anchor\" href=\"#what-s-new-in-django-6-2\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h2>\n<section id=\"adopting-calendar-versioning\">\n<h3>Adopting calendar versioning<a class=\"heading-anchor\" href=\"#adopting-calendar-versioning\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h3>\n<p>Following <a class=\"reference external\" href=\"https://github.com/django/deps/blob/main/accepted/0020-annual-release-cycle.rst\">DEP 20</a>, the releases previously planned as Django 7.0 and 7.1 are\nnow Django 2028 and 2029. Accordingly, the deprecation warning classes are\nrenamed to match the calendar version in which the features they mark are\nremoved: <code class=\"docutils literal notranslate\">RemovedInDjango70Warning</code> becomes <code class=\"docutils literal notranslate\">RemovedInDjango2028Warning</code>,\nand <code class=\"docutils literal notranslate\">RemovedInDjango71Warning</code> becomes <code class=\"docutils literal notranslate\">RemovedInDjango2029Warning</code>.</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>…</p></li>\n</ul>\n</section>\n<section id=\"django-contrib-admindocs\">\n<h4><a class=\"reference internal\" href=\"/en/dev/ref/contrib/admin/admindocs/#module-django.contrib.admindocs\" title=\"django.contrib.admindocs: Django's admin documentation generator.\"><code class=\"xref py py-mod docutils literal notranslate\">django.contrib.admindocs</code></a><a class=\"heading-anchor\" href=\"#django-contrib-admindocs\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h4>\n<ul class=\"simple\">\n<li><p>…</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,500,000 to 1,800,000.</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>…</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/gdal/#django.contrib.gis.gdal.DataSource\" title=\"django.contrib.gis.gdal.DataSource\"><code class=\"xref py py-class docutils literal notranslate\">DataSource</code></a> now preserves millisecond\nprecision when reading time and datetime fields.</p></li>\n</ul>\n</section>\n<section id=\"django-contrib-messages\">\n<h4><a class=\"reference internal\" href=\"/en/dev/ref/contrib/messages/#module-django.contrib.messages\" title=\"django.contrib.messages: Provides cookie- and session-based temporary message storage.\"><code class=\"xref py py-mod docutils literal notranslate\">django.contrib.messages</code></a><a class=\"heading-anchor\" href=\"#django-contrib-messages\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h4>\n<ul class=\"simple\">\n<li><p>…</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>…</p></li>\n</ul>\n</section>\n<section id=\"django-contrib-redirects\">\n<h4><a class=\"reference internal\" href=\"/en/dev/ref/contrib/redirects/#module-django.contrib.redirects\" title=\"django.contrib.redirects: A framework for managing redirects.\"><code class=\"xref py py-mod docutils literal notranslate\">django.contrib.redirects</code></a><a class=\"heading-anchor\" href=\"#django-contrib-redirects\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h4>\n<ul class=\"simple\">\n<li><p>…</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>…</p></li>\n</ul>\n</section>\n<section id=\"django-contrib-sitemaps\">\n<h4><a class=\"reference internal\" href=\"/en/dev/ref/contrib/sitemaps/#module-django.contrib.sitemaps\" title=\"django.contrib.sitemaps: A framework for generating Google sitemap XML files.\"><code class=\"xref py py-mod docutils literal notranslate\">django.contrib.sitemaps</code></a><a class=\"heading-anchor\" href=\"#django-contrib-sitemaps\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h4>\n<ul class=\"simple\">\n<li><p>…</p></li>\n</ul>\n</section>\n<section id=\"django-contrib-sites\">\n<h4><a class=\"reference internal\" href=\"/en/dev/ref/contrib/sites/#module-django.contrib.sites\" title=\"django.contrib.sites: Lets you operate multiple websites from the same database and Django project\"><code class=\"xref py py-mod docutils literal notranslate\">django.contrib.sites</code></a><a class=\"heading-anchor\" href=\"#django-contrib-sites\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h4>\n<ul class=\"simple\">\n<li><p>…</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>…</p></li>\n</ul>\n</section>\n<section id=\"django-contrib-syndication\">\n<h4><a class=\"reference internal\" href=\"/en/dev/ref/contrib/syndication/#module-django.contrib.syndication\" title=\"django.contrib.syndication: A framework for generating syndication feeds, in RSS and Atom, quite easily.\"><code class=\"xref py py-mod docutils literal notranslate\">django.contrib.syndication</code></a><a class=\"heading-anchor\" href=\"#django-contrib-syndication\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h4>\n<ul class=\"simple\">\n<li><p>…</p></li>\n</ul>\n</section>\n<section id=\"asynchronous-views\">\n<h4>Asynchronous views<a class=\"heading-anchor\" href=\"#asynchronous-views\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h4>\n<ul class=\"simple\">\n<li><p>…</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>Subclasses of <code class=\"docutils literal notranslate\">BaseDatabaseCache</code> now support <a class=\"reference internal\" href=\"/en/dev/topics/cache/#database-caching\"><span class=\"std std-ref\">culling</span></a> on a percentage of writes as an optimization. The\ndefault is 10%, and may be configured using the <code class=\"docutils literal notranslate\">CULL_PROBABILITY</code> option.</p></li>\n</ul>\n</section>\n<section id=\"csp\">\n<h4>CSP<a class=\"heading-anchor\" href=\"#csp\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h4>\n<ul class=\"simple\">\n<li><p>…</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>…</p></li>\n</ul>\n</section>\n<section id=\"database-backends\">\n<h4>Database backends<a class=\"heading-anchor\" href=\"#database-backends\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h4>\n<ul class=\"simple\">\n<li><p>…</p></li>\n</ul>\n</section>\n<section id=\"decorators\">\n<h4>Decorators<a class=\"heading-anchor\" href=\"#decorators\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h4>\n<ul class=\"simple\">\n<li><p>…</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-ADMINS\"><code class=\"xref std std-setting docutils literal notranslate\">ADMINS</code></a>, <a class=\"reference internal\" href=\"/en/dev/ref/settings/#std-setting-DEFAULT_FROM_EMAIL\"><code class=\"xref std std-setting docutils literal notranslate\">DEFAULT_FROM_EMAIL</code></a>, <a class=\"reference internal\" href=\"/en/dev/ref/settings/#std-setting-MANAGERS\"><code class=\"xref std std-setting docutils literal notranslate\">MANAGERS</code></a>,\nand <a class=\"reference internal\" href=\"/en/dev/ref/settings/#std-setting-SERVER_EMAIL\"><code class=\"xref std std-setting docutils literal notranslate\">SERVER_EMAIL</code></a> settings now support\n<a class=\"reference external\" href=\"https://docs.python.org/3/library/email.headerregistry.html#email.headerregistry.Address\" title=\"(in Python v3.14)\"><code class=\"xref py py-class docutils literal notranslate\">Address</code></a> objects.</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>…</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>…</p></li>\n</ul>\n</section>\n<section id=\"file-uploads\">\n<h4>File Uploads<a class=\"heading-anchor\" href=\"#file-uploads\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h4>\n<ul class=\"simple\">\n<li><p>…</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 class=\"simple\">\n<li><p>…</p></li>\n</ul>\n</section>\n<section id=\"generic-views\">\n<h4>Generic Views<a class=\"heading-anchor\" href=\"#generic-views\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h4>\n<ul class=\"simple\">\n<li><p>…</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>…</p></li>\n</ul>\n</section>\n<section id=\"logging\">\n<h4>Logging<a class=\"heading-anchor\" href=\"#logging\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h4>\n<ul class=\"simple\">\n<li><p>…</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/#django-admin-listurls\"><code class=\"xref std std-djadmin docutils literal notranslate\">listurls</code></a> command lists the URLs from the project’s root\nURLconf, including the view class or function (and name, if present).</p></li>\n<li><p>The <a class=\"reference internal\" href=\"/en/dev/ref/django-admin/#django-admin-makemigrations\"><code class=\"xref std std-djadmin docutils literal notranslate\">makemigrations</code></a> command now tracks all changes to unmanaged\nmodels, including field additions, removals, alterations, constraints, and\nmodel renames. After upgrading, you will see new migrations detected for\nunmanaged models that have changed since their creation.</p></li>\n<li><p>Whether to suppress an <a class=\"reference external\" href=\"https://docs.python.org/3/library/exceptions.html#ImportError\" title=\"(in Python v3.14)\"><code class=\"xref py py-exc docutils literal notranslate\">ImportError</code></a> escaping from a settings module is\nconfigurable by the new <a class=\"reference internal\" href=\"/en/dev/howto/custom-management-commands/#django.core.management.BaseCommand.requires_settings\" title=\"django.core.management.BaseCommand.requires_settings\"><code class=\"xref py py-attr docutils literal notranslate\">BaseCommand.requires_settings</code></a> attribute\n(default <code class=\"docutils literal notranslate\">True</code>). In previous versions, such errors were always suppressed.</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>…</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>…</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>…</p></li>\n</ul>\n</section>\n<section id=\"security\">\n<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 class=\"simple\">\n<li><p>…</p></li>\n</ul>\n</section>\n<section id=\"serialization\">\n<h4>Serialization<a class=\"heading-anchor\" href=\"#serialization\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h4>\n<ul class=\"simple\">\n<li><p>…</p></li>\n</ul>\n</section>\n<section id=\"signals\">\n<h4>Signals<a class=\"heading-anchor\" href=\"#signals\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h4>\n<ul class=\"simple\">\n<li><p>…</p></li>\n</ul>\n</section>\n<section id=\"tasks\">\n<h4>Tasks<a class=\"heading-anchor\" href=\"#tasks\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h4>\n<ul class=\"simple\">\n<li><p>…</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>…</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.Client.force_login\" title=\"django.test.Client.force_login\"><code class=\"xref py py-meth docutils literal notranslate\">force_login()</code></a> now skips members of\n<a class=\"reference internal\" href=\"/en/dev/ref/settings/#std-setting-AUTHENTICATION_BACKENDS\"><code class=\"xref std std-setting docutils literal notranslate\">AUTHENTICATION_BACKENDS</code></a> not implementing <code class=\"docutils literal notranslate\">(a)get_user()</code>, e.g.\npermission-only backends.</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>…</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.module_loading.import_string\" title=\"django.utils.module_loading.import_string\"><code class=\"xref py py-func docutils literal notranslate\">utils.module_loading.import_string()</code></a> now supports modules. Previously,\ntop-level modules did not work, and submodules only worked if already\nimported.</p></li>\n<li><p>The new <a class=\"reference internal\" href=\"/en/dev/ref/utils/#django.utils.asyncio.maybe_aclosing\" title=\"django.utils.asyncio.maybe_aclosing\"><code class=\"xref py py-func docutils literal notranslate\">django.utils.asyncio.maybe_aclosing()</code></a> returns a context manager\nthat calls <code class=\"docutils literal notranslate\">aclose()</code> on a caller-provided iterator only if it defines one.</p></li>\n<li><p>…</p></li>\n</ul>\n</section>\n<section id=\"validators\">\n<h4>Validators<a class=\"heading-anchor\" href=\"#validators\"><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/validators/#django.core.validators.EmailValidator\" title=\"django.core.validators.EmailValidator\"><code class=\"xref py py-class docutils literal notranslate\">EmailValidator</code></a> now includes the invalid\n<code class=\"docutils literal notranslate\">username</code> or <code class=\"docutils literal notranslate\">domain</code> in the <code class=\"docutils literal notranslate\">params</code> dict of the\n<a class=\"reference internal\" href=\"/en/dev/ref/exceptions/#django.core.exceptions.ValidationError\" title=\"django.core.exceptions.ValidationError\"><code class=\"xref py py-exc docutils literal notranslate\">ValidationError</code></a> it raises. The new\n<a class=\"reference internal\" href=\"/en/dev/ref/validators/#django.core.validators.EmailValidator.parse_address\" title=\"django.core.validators.EmailValidator.parse_address\"><code class=\"xref py py-meth docutils literal notranslate\">parse_address()</code></a>,\n<a class=\"reference internal\" href=\"/en/dev/ref/validators/#django.core.validators.EmailValidator.validate\" title=\"django.core.validators.EmailValidator.validate\"><code class=\"xref py py-meth docutils literal notranslate\">validate()</code></a>,\n<a class=\"reference internal\" href=\"/en/dev/ref/validators/#django.core.validators.EmailValidator.validate_domain\" title=\"django.core.validators.EmailValidator.validate_domain\"><code class=\"xref py py-meth docutils literal notranslate\">validate_domain()</code></a>, and\n<a class=\"reference internal\" href=\"/en/dev/ref/validators/#django.core.validators.EmailValidator.validate_username\" title=\"django.core.validators.EmailValidator.validate_username\"><code class=\"xref py py-meth docutils literal notranslate\">validate_username()</code></a> methods can\nbe overridden to customize how the address is parsed and validated.</p></li>\n</ul>\n</section>\n</section>\n</section>\n<section id=\"backwards-incompatible-changes-in-6-2\">\n<span id=\"backwards-incompatible-6-2\"></span><h2>Backwards incompatible changes in 6.2<a class=\"heading-anchor\" href=\"#backwards-incompatible-changes-in-6-2\"><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>…</p></li>\n</ul>\n</section>\n<section id=\"id1\">\n<h3><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=\"#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 admin <code class=\"docutils literal notranslate\">view_on_site</code> URL now consistently returns an HTTP 403 response\nwhen a staff user lacks view or change permission for the target model.</p></li>\n<li><p>The admin history view now checks permissions before object existence,\nconsistently returning an HTTP 403 response for staff users without the view\nor change permission regardless of whether the object exists.</p></li>\n<li><p>The undocumented <code class=\"docutils literal notranslate\">django.contrib.admin.tests</code> module was removed.</p></li>\n</ul>\n</section>\n<section id=\"id2\">\n<h3><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=\"#id2\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h3>\n<ul class=\"simple\">\n<li><p>The seconds value returned by\n<a class=\"reference internal\" href=\"/en/dev/ref/contrib/gis/gdal/#django.contrib.gis.gdal.Field.as_datetime\" title=\"django.contrib.gis.gdal.Field.as_datetime\"><code class=\"xref py py-meth docutils literal notranslate\">as_datetime()</code></a> is now a <code class=\"docutils literal notranslate\">c_float</code>\nrather than a <code class=\"docutils literal notranslate\">c_int</code>.</p></li>\n<li><p>Support for PostGIS 3.2 is removed.</p></li>\n<li><p>Support for GDAL 3.3 and 3.4 is removed.</p></li>\n<li><p>Support for GEOS 3.10 is removed.</p></li>\n</ul>\n</section>\n<section id=\"id3\">\n<h3>Models<a class=\"heading-anchor\" href=\"#id3\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h3>\n<ul class=\"simple\">\n<li><p>Unsaved instances with a composite primary key or a <code class=\"docutils literal notranslate\">db_default</code> primary\nkey no longer compare equal to other instances.</p></li>\n<li><p><a class=\"reference internal\" href=\"/en/dev/ref/models/fields/#django.db.models.GenericIPAddressField\" title=\"django.db.models.GenericIPAddressField\"><code class=\"xref py py-class docutils literal notranslate\">django.db.models.GenericIPAddressField</code></a> now validates IPv6 input\nstrictly when saving and querying. Invalid IPv6 addresses now raise\n<code class=\"docutils literal notranslate\">ValidationError</code> instead of being silently accepted, and surrounding\nwhitespace is stripped.</p></li>\n</ul>\n</section>\n<section id=\"id4\">\n<h3>Requests and responses<a class=\"heading-anchor\" href=\"#id4\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h3>\n<ul class=\"simple\">\n<li><p>Most Django-provided middleware now set <code class=\"docutils literal notranslate\">async_capable = False</code> to\navoid repetitive context switching in <code class=\"docutils literal notranslate\">MiddlewareMixin.__acall__()</code> under\nASGI. For atypical use cases, e.g. high in-process concurrency over non-ORM\nI/O, where no thread is otherwise held, the repetitive context switching may\nbe preferable to pinning a thread per request (see <a class=\"reference internal\" href=\"/en/dev/topics/async/#async-performance\"><span class=\"std std-ref\">Performance</span></a>).\nSuch deployments can restore the prior behavior by setting\n<code class=\"docutils literal notranslate\">async_capable = True</code>; see <a class=\"reference internal\" href=\"/en/dev/topics/http/middleware/#upgrading-middleware\"><span class=\"std std-ref\">MiddlewareMixin</span></a>.\n<a class=\"reference internal\" href=\"/en/dev/ref/middleware/#django.contrib.auth.middleware.RemoteUserMiddleware\" title=\"django.contrib.auth.middleware.RemoteUserMiddleware\"><code class=\"xref py py-class docutils literal notranslate\">RemoteUserMiddleware</code></a> is unaffected,\nbecause it does not use <code class=\"docutils literal notranslate\">MiddlewareMixin</code>. Neither is\n<a class=\"reference internal\" href=\"/en/dev/ref/middleware/#django.contrib.auth.middleware.LoginRequiredMiddleware\" title=\"django.contrib.auth.middleware.LoginRequiredMiddleware\"><code class=\"xref py py-class docutils literal notranslate\">LoginRequiredMiddleware</code></a> nor\n<code class=\"docutils literal notranslate\">django.contrib.admindocs.middleware.XViewMiddleware</code> affected, as they did\nnot implement <code class=\"docutils literal notranslate\">process_request()</code> or <code class=\"docutils literal notranslate\">process_response()</code>.</p></li>\n</ul>\n</section>\n<section id=\"id5\">\n<h3>Tests<a class=\"heading-anchor\" href=\"#id5\"><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\">django.test.selenium</code> module was removed.</p></li>\n</ul>\n</section>\n<section id=\"dropped-support-for-postgresql-15\">\n<h3>Dropped support for PostgreSQL 15<a class=\"heading-anchor\" href=\"#dropped-support-for-postgresql-15\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h3>\n<p>Upstream support for PostgreSQL 15 ends in November 2027. Django 6.2 supports\nPostgreSQL 16 and higher.</p>\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>To facilitate the deprecation of the <code class=\"docutils literal notranslate\">safe</code> parameter of\n<a class=\"reference internal\" href=\"/en/dev/ref/request-response/#django.http.JsonResponse\" title=\"django.http.JsonResponse\"><code class=\"xref py py-class docutils literal notranslate\">JsonResponse</code></a>, it now defaults to <code class=\"docutils literal notranslate\">False</code>, because the\npollution vulnerability in the <code class=\"docutils literal notranslate\">Array</code> prototype was fixed in\n<a class=\"reference external\" href=\"https://262.ecma-international.org/5.1/#sec-11.1.4\">ES5</a>.</p></li>\n<li><p><a class=\"reference internal\" href=\"/en/dev/topics/serialization/#django.core.serializers.json.DjangoJSONEncoder\" title=\"django.core.serializers.json.DjangoJSONEncoder\"><code class=\"xref py py-class docutils literal notranslate\">DjangoJSONEncoder</code></a> now omits the\nmillisecond component of serialized <code class=\"docutils literal notranslate\">datetime.datetime</code> and\n<code class=\"docutils literal notranslate\">datetime.time</code> objects if they have zero milliseconds. For example,\n<code class=\"docutils literal notranslate\">datetime.datetime(2000, 1, 1, 0, 0, 0, 1)</code> now serializes to\n<code class=\"docutils literal notranslate\">&quot;2000-01-01T00:00:00&quot;</code> rather than <code class=\"docutils literal notranslate\">&quot;2000-01-01T00:00:00.000&quot;</code>.</p></li>\n<li><p><a class=\"reference internal\" href=\"/en/dev/ref/utils/#django.utils.module_loading.import_string\" title=\"django.utils.module_loading.import_string\"><code class=\"xref py py-func docutils literal notranslate\">utils.module_loading.import_string()</code></a> now deterministically favors\nsubmodules in ambiguous cases where depending on prior import state, a\nsame-named attribute of the parent module might have been returned instead.</p></li>\n<li><p>The minimum supported version of <code class=\"docutils literal notranslate\">asgiref</code> is increased from 3.9.1 to\n3.12.1.</p></li>\n<li><p>The minimum supported version of <code class=\"docutils literal notranslate\">oracledb</code> is increased from 2.3.0 to\n4.0.2.</p></li>\n<li><p>In the asynchronous request path, error responses (such as those rendered by\n<code class=\"docutils literal notranslate\">handler404</code> and <code class=\"docutils literal notranslate\">handler500</code>) are now rendered on the request’s\nthread-sensitive thread, rather than on a shared thread pool, so that\ndatabase connections used during error handling are managed by\n<code class=\"docutils literal notranslate\">close_old_connections()</code>.</p></li>\n</ul>\n</section>\n</section>\n<section id=\"features-deprecated-in-6-2\">\n<span id=\"deprecated-features-6-2\"></span><h2>Features deprecated in 6.2<a class=\"heading-anchor\" href=\"#features-deprecated-in-6-2\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h2>\n<section id=\"id6\">\n<h3>Validators<a class=\"heading-anchor\" href=\"#id6\"><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\">EmailValidator.validate_domain_part()</code> method is\ndeprecated in favor of the new\n<a class=\"reference internal\" href=\"/en/dev/ref/validators/#django.core.validators.EmailValidator.validate_domain\" title=\"django.core.validators.EmailValidator.validate_domain\"><code class=\"xref py py-meth docutils literal notranslate\">validate_domain()</code></a> method.</p></li>\n</ul>\n</section>\n<section id=\"id7\">\n<h3>Miscellaneous<a class=\"heading-anchor\" href=\"#id7\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h3>\n<ul>\n<li><p>Indexing <code class=\"docutils literal notranslate\">django.VERSION</code> from its third component on, reading it in a way\nwhich depends on its length, such as unpacking it or calling <code class=\"docutils literal notranslate\">len()</code> on it,\nand comparing it against three or more components are all deprecated. Under\nthe calendar versioning adopted in <a class=\"reference external\" href=\"https://github.com/django/deps/blob/main/accepted/0020-annual-release-cycle.rst\">DEP 20</a>, versions are <code class=\"docutils literal notranslate\">YYYY[.N]</code> and\nhave no minor component, so from Django 2028 <code class=\"docutils literal notranslate\">django.VERSION</code> has four\ncomponents, <code class=\"docutils literal notranslate\">(year, patch, status, iteration)</code>. Use the <code class=\"docutils literal notranslate\">.feature</code>,\n<code class=\"docutils literal notranslate\">.patch</code>, <code class=\"docutils literal notranslate\">.status</code>, and <code class=\"docutils literal notranslate\">.iteration</code> attributes, which give the same\nanswers under both versioning schemes:</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>django<span class=\"o\">.</span>VERSION<span class=\"o\">.</span>feature  <span class=\"c1\"># (6, 2) for 6.2.1, and (2028,) for 2028.1</span>\ndjango<span class=\"o\">.</span>VERSION<span class=\"o\">.</span>patch  <span class=\"c1\"># 1 for both 6.2.1 and 2028.1</span>\n</code></pre></div>\n<p>Comparisons against one or two components, such as\n<code class=\"docutils literal notranslate\">django.VERSION &gt;= (6, 2)</code>, are unaffected.</p>\n</li>\n<li><p>The <a class=\"reference internal\" href=\"/en/dev/topics/http/middleware/#django.middleware.MiddlewareMixin\" title=\"django.middleware.MiddlewareMixin\"><code class=\"xref py py-class docutils literal notranslate\">MiddlewareMixin</code></a> class moved from\n<code class=\"docutils literal notranslate\">django.utils.deprecation</code> to <code class=\"docutils literal notranslate\">django.middleware</code>. The old import path\nis deprecated.</p></li>\n<li><p>The <code class=\"docutils literal notranslate\">safe</code> parameter is deprecated from <a class=\"reference internal\" href=\"/en/dev/ref/request-response/#django.http.JsonResponse\" title=\"django.http.JsonResponse\"><code class=\"xref py py-class docutils literal notranslate\">JsonResponse</code></a>.\nOmitting the argument is equivalent to the prior <code class=\"docutils literal notranslate\">safe=False</code> usage.</p></li>\n<li><p>Calling <a class=\"reference internal\" href=\"/en/dev/ref/models/querysets/#django.db.models.query.QuerySet.aiterator\" title=\"django.db.models.query.QuerySet.aiterator\"><code class=\"xref py py-meth docutils literal notranslate\">QuerySet.aiterator()</code></a> after <code class=\"docutils literal notranslate\">prefetch_related()</code> without\nproviding a <code class=\"docutils literal notranslate\">chunk_size</code> is deprecated. It currently falls back to a\n<code class=\"docutils literal notranslate\">chunk_size</code> of 2000, but a <code class=\"docutils literal notranslate\">ValueError</code> will be raised in\nDjango 2029.</p></li>\n<li><p>Omitting the <code class=\"docutils literal notranslate\">tzinfo</code> argument of\n<a class=\"reference internal\" href=\"/en/dev/ref/models/database-functions/#django.db.models.functions.Extract\" title=\"django.db.models.functions.Extract\"><code class=\"xref py py-class docutils literal notranslate\">Extract</code></a> and\n<a class=\"reference internal\" href=\"/en/dev/ref/models/database-functions/#django.db.models.functions.Trunc\" title=\"django.db.models.functions.Trunc\"><code class=\"xref py py-class docutils literal notranslate\">Trunc</code></a> database functions when used in\nmigrations (for example as a\n<a class=\"reference internal\" href=\"/en/dev/ref/models/fields/#django.db.models.Field.db_default\" title=\"django.db.models.Field.db_default\"><code class=\"xref py py-attr docutils literal notranslate\">db_default</code></a>) and <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>\nis <code class=\"docutils literal notranslate\">True</code> is deprecated. The timezone information is not captured during\nmigration serialization, which can lead to inconsistent behavior if\n<a class=\"reference internal\" href=\"/en/dev/ref/settings/#std-setting-TIME_ZONE\"><code class=\"xref std std-setting docutils literal notranslate\">TIME_ZONE</code></a> changes. Pass the <code class=\"docutils literal notranslate\">tzinfo</code> argument explicitly to\nsuppress this warning. In Django 2029, the current timezone will be captured\nautomatically when <code class=\"docutils literal notranslate\">tzinfo</code> is omitted.</p></li>\n</ul>\n</section>\n</section>","rootId":"django-6-2-release-notes-under-development","toc":[{"title":"Python compatibility","anchor":"python-compatibility","children":[]},{"title":"What’s new in Django 6.2","anchor":"what-s-new-in-django-6-2","children":[{"title":"Adopting calendar versioning","anchor":"adopting-calendar-versioning","children":[]},{"title":"Minor features","anchor":"minor-features","children":[{"title":"django.contrib.admin","anchor":"django-contrib-admin","children":[]},{"title":"django.contrib.admindocs","anchor":"django-contrib-admindocs","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.messages","anchor":"django-contrib-messages","children":[]},{"title":"django.contrib.postgres","anchor":"django-contrib-postgres","children":[]},{"title":"django.contrib.redirects","anchor":"django-contrib-redirects","children":[]},{"title":"django.contrib.sessions","anchor":"django-contrib-sessions","children":[]},{"title":"django.contrib.sitemaps","anchor":"django-contrib-sitemaps","children":[]},{"title":"django.contrib.sites","anchor":"django-contrib-sites","children":[]},{"title":"django.contrib.staticfiles","anchor":"django-contrib-staticfiles","children":[]},{"title":"django.contrib.syndication","anchor":"django-contrib-syndication","children":[]},{"title":"Asynchronous views","anchor":"asynchronous-views","children":[]},{"title":"Cache","anchor":"cache","children":[]},{"title":"CSP","anchor":"csp","children":[]},{"title":"CSRF","anchor":"csrf","children":[]},{"title":"Database backends","anchor":"database-backends","children":[]},{"title":"Decorators","anchor":"decorators","children":[]},{"title":"Email","anchor":"email","children":[]},{"title":"Error Reporting","anchor":"error-reporting","children":[]},{"title":"File Storage","anchor":"file-storage","children":[]},{"title":"File Uploads","anchor":"file-uploads","children":[]},{"title":"Forms","anchor":"forms","children":[]},{"title":"Generic Views","anchor":"generic-views","children":[]},{"title":"Internationalization","anchor":"internationalization","children":[]},{"title":"Logging","anchor":"logging","children":[]},{"title":"Management Commands","anchor":"management-commands","children":[]},{"title":"Migrations","anchor":"migrations","children":[]},{"title":"Models","anchor":"models","children":[]},{"title":"Requests and Responses","anchor":"requests-and-responses","children":[]},{"title":"Security","anchor":"security","children":[]},{"title":"Serialization","anchor":"serialization","children":[]},{"title":"Signals","anchor":"signals","children":[]},{"title":"Tasks","anchor":"tasks","children":[]},{"title":"Templates","anchor":"templates","children":[]},{"title":"Tests","anchor":"tests","children":[]},{"title":"URLs","anchor":"urls","children":[]},{"title":"Utilities","anchor":"utilities","children":[]},{"title":"Validators","anchor":"validators","children":[]}]}]},{"title":"Backwards incompatible changes in 6.2","anchor":"backwards-incompatible-changes-in-6-2","children":[{"title":"Database backend API","anchor":"database-backend-api","children":[]},{"title":"django.contrib.admin","anchor":"id1","children":[]},{"title":"django.contrib.gis","anchor":"id2","children":[]},{"title":"Models","anchor":"id3","children":[]},{"title":"Requests and responses","anchor":"id4","children":[]},{"title":"Tests","anchor":"id5","children":[]},{"title":"Dropped support for PostgreSQL 15","anchor":"dropped-support-for-postgresql-15","children":[]},{"title":"Miscellaneous","anchor":"miscellaneous","children":[]}]},{"title":"Features deprecated in 6.2","anchor":"features-deprecated-in-6-2","children":[{"title":"Validators","anchor":"id6","children":[]},{"title":"Miscellaneous","anchor":"id7","children":[]}]}],"breadcrumbs":[{"docname":"releases/index","title":"Release notes","url":"/en/dev/releases/"}],"prev":{"docname":"releases/index","title":"Release notes","url":"/en/dev/releases/"},"next":{"docname":"releases/6.1.2","title":"Django 6.1.2 release notes","url":"/en/dev/releases/6.1.2/"},"formats":{"html":"/en/dev/releases/6.2/","markdown":"/en/dev/releases/6.2.md","json":"/en/dev/releases/6.2.json"},"source":"https://github.com/django/django/blob/main/docs/releases/6.2.txt","official":"https://docs.djangoproject.com/en/dev/releases/6.2/","inVersions":["dev"],"inLocales":["en"]}