{"title":"Django 3.0 release notes","version":"dev","locale":"en","docname":"releases/3.0","url":"/en/dev/releases/3.0/","canonical":"https://djangodocs.dev/en/dev/releases/3.0/","summary":"Welcome to Django 3.0! These release notes cover the new features, as well as some backwards incompatible changes you’ll want to be aware of when upgrading…","html":"<h1>Django 3.0 release notes<a class=\"heading-anchor\" href=\"#django-3-0-release-notes\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h1>\n<p><em>December 2, 2019</em></p>\n<p>Welcome to Django 3.0!</p>\n<p>These release notes cover the <a class=\"reference internal\" href=\"#whats-new-3-0\"><span class=\"std std-ref\">new features</span></a>, as well as\nsome <a class=\"reference internal\" href=\"#backwards-incompatible-3-0\"><span class=\"std std-ref\">backwards incompatible changes</span></a> you’ll\nwant to be aware of when upgrading from Django 2.2 or earlier. We’ve\n<a class=\"reference internal\" href=\"#removed-features-3-0\"><span class=\"std std-ref\">dropped some features</span></a> that have reached the end of\ntheir deprecation cycle, and we’ve <a class=\"reference internal\" href=\"#deprecated-features-3-0\"><span class=\"std std-ref\">begun the deprecation process for\nsome features</span></a>.</p>\n<p>See the <a class=\"reference internal\" href=\"/en/dev/howto/upgrade-version/\"><span class=\"doc\">How to upgrade Django to a newer version</span></a> guide if you’re updating an existing\nproject.</p>\n<section id=\"python-compatibility\">\n<h2>Python compatibility<a class=\"heading-anchor\" href=\"#python-compatibility\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h2>\n<p>Django 3.0 supports Python 3.6, 3.7, 3.8, and 3.9 (as of 3.0.11). We <strong>highly\nrecommend</strong> and only officially support the latest release of each series.</p>\n<p>The Django 2.2.x series is the last to support Python 3.5.</p>\n</section>\n<section id=\"third-party-library-support-for-older-version-of-django\">\n<h2>Third-party library support for older version of Django<a class=\"heading-anchor\" href=\"#third-party-library-support-for-older-version-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 3.0, we suggest that third-party app authors\ndrop support for all versions of Django prior to 2.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 3.0.</p>\n</section>\n<section id=\"what-s-new-in-django-3-0\">\n<span id=\"whats-new-3-0\"></span><h2>What’s new in Django 3.0<a class=\"heading-anchor\" href=\"#what-s-new-in-django-3-0\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h2>\n<section id=\"mariadb-support\">\n<h3>MariaDB support<a class=\"heading-anchor\" href=\"#mariadb-support\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h3>\n<p>Django now officially supports <a class=\"reference external\" href=\"https://mariadb.org/\">MariaDB</a> 10.1 and\nhigher. See <a class=\"reference internal\" href=\"/en/dev/ref/databases/#mariadb-notes\"><span class=\"std std-ref\">MariaDB notes</span></a> for more details.</p>\n</section>\n<section id=\"asgi-support\">\n<h3>ASGI support<a class=\"heading-anchor\" href=\"#asgi-support\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h3>\n<p>Django 3.0 begins our journey to making Django fully async-capable by providing\nsupport for running as an <a class=\"reference external\" href=\"https://asgi.readthedocs.io/\">ASGI</a> application.</p>\n<p>This is in addition to our existing WSGI support. Django intends to support\nboth for the foreseeable future. Async features will only be available to\napplications that run under ASGI, however.</p>\n<p>At this stage async support only applies to the outer ASGI application.\nInternally everything remains synchronous. Asynchronous middleware, views, etc.\nare not yet supported. You can, however, use ASGI middleware around Django’s\napplication, allowing you to combine Django with other ASGI frameworks.</p>\n<p>There is no need to switch your applications over unless you want to start\nexperimenting with asynchronous code, but we have\n<a class=\"reference internal\" href=\"/en/dev/howto/deployment/asgi/\"><span class=\"doc\">documentation on deploying with ASGI</span></a> if\nyou want to learn more.</p>\n<p>Note that as a side-effect of this change, Django is now aware of asynchronous\nevent loops and will block you calling code marked as “async unsafe” - such as\nORM operations - from an asynchronous context. If you were using Django from\nasync code before, this may trigger if you were doing it incorrectly. If you\nsee a <code class=\"docutils literal notranslate\">SynchronousOnlyOperation</code> error, then closely examine your code and\nmove any database operations to be in a synchronous child thread.</p>\n</section>\n<section id=\"exclusion-constraints-on-postgresql\">\n<h3>Exclusion constraints on PostgreSQL<a class=\"heading-anchor\" href=\"#exclusion-constraints-on-postgresql\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h3>\n<p>The new <a class=\"reference internal\" href=\"/en/dev/ref/contrib/postgres/constraints/#django.contrib.postgres.constraints.ExclusionConstraint\" title=\"django.contrib.postgres.constraints.ExclusionConstraint\"><code class=\"xref py py-class docutils literal notranslate\">ExclusionConstraint</code></a> class\nenable adding exclusion constraints on PostgreSQL. Constraints are added to\nmodels using the\n<a class=\"reference internal\" href=\"/en/dev/ref/models/options/#django.db.models.Options.constraints\" title=\"django.db.models.Options.constraints\"><code class=\"xref py py-attr docutils literal notranslate\">Meta.constraints</code></a> option.</p>\n</section>\n<section id=\"filter-expressions\">\n<h3>Filter expressions<a class=\"heading-anchor\" href=\"#filter-expressions\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h3>\n<p>Expressions that output <a class=\"reference internal\" href=\"/en/dev/ref/models/fields/#django.db.models.BooleanField\" title=\"django.db.models.BooleanField\"><code class=\"xref py py-class docutils literal notranslate\">BooleanField</code></a> may now be\nused directly in <code class=\"docutils literal notranslate\">QuerySet</code> filters, without having to first annotate and\nthen filter against the annotation.</p>\n</section>\n<section id=\"enumerations-for-model-field-choices\">\n<h3>Enumerations for model field choices<a class=\"heading-anchor\" href=\"#enumerations-for-model-field-choices\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h3>\n<p>Custom enumeration types <code class=\"docutils literal notranslate\">TextChoices</code>, <code class=\"docutils literal notranslate\">IntegerChoices</code>, and <code class=\"docutils literal notranslate\">Choices</code>\nare now available as a way to define <a class=\"reference internal\" href=\"/en/dev/ref/models/fields/#django.db.models.Field.choices\" title=\"django.db.models.Field.choices\"><code class=\"xref py py-attr docutils literal notranslate\">Field.choices</code></a>. <code class=\"docutils literal notranslate\">TextChoices</code>\nand <code class=\"docutils literal notranslate\">IntegerChoices</code> types are provided for text and integer fields. The\n<code class=\"docutils literal notranslate\">Choices</code> class allows defining a compatible enumeration for other concrete\ndata types. These custom enumeration types support human-readable labels that\ncan be translated and accessed via a property on the enumeration or its\nmembers. See <a class=\"reference internal\" href=\"/en/dev/ref/models/fields/#field-choices-enum-types\"><span class=\"std std-ref\">Enumeration types</span></a> for more\ndetails and examples.</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>Added support for the <code class=\"docutils literal notranslate\">admin_order_field</code> attribute on properties in\n<a class=\"reference internal\" href=\"/en/dev/ref/contrib/admin/#django.contrib.admin.ModelAdmin.list_display\" title=\"django.contrib.admin.ModelAdmin.list_display\"><code class=\"xref py py-attr docutils literal notranslate\">ModelAdmin.list_display</code></a>.</p></li>\n<li><p>The new <a class=\"reference internal\" href=\"/en/dev/ref/contrib/admin/#django.contrib.admin.ModelAdmin.get_inlines\" title=\"django.contrib.admin.ModelAdmin.get_inlines\"><code class=\"xref py py-meth docutils literal notranslate\">ModelAdmin.get_inlines()</code></a> method allows specifying the\ninlines based on the request or model instance.</p></li>\n<li><p>Select2 library is upgraded from version 4.0.3 to 4.0.7.</p></li>\n<li><p>jQuery is upgraded from version 3.3.1 to 3.4.1.</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 new <code class=\"docutils literal notranslate\">reset_url_token</code> attribute in\n<a class=\"reference internal\" href=\"/en/dev/topics/auth/default/#django.contrib.auth.views.PasswordResetConfirmView\" title=\"django.contrib.auth.views.PasswordResetConfirmView\"><code class=\"xref py py-class docutils literal notranslate\">PasswordResetConfirmView</code></a> allows\nspecifying a token parameter displayed as a component of password reset\nURLs.</p></li>\n<li><p>Added <a class=\"reference internal\" href=\"/en/dev/ref/contrib/auth/#django.contrib.auth.backends.BaseBackend\" title=\"django.contrib.auth.backends.BaseBackend\"><code class=\"xref py py-class docutils literal notranslate\">BaseBackend</code></a> class to ease\ncustomization of authentication backends.</p></li>\n<li><p>Added <a class=\"reference internal\" href=\"/en/dev/ref/contrib/auth/#django.contrib.auth.models.User.get_user_permissions\" title=\"django.contrib.auth.models.User.get_user_permissions\"><code class=\"xref py py-meth docutils literal notranslate\">get_user_permissions()</code></a> method\nto mirror the existing\n<a class=\"reference internal\" href=\"/en/dev/ref/contrib/auth/#django.contrib.auth.models.User.get_group_permissions\" title=\"django.contrib.auth.models.User.get_group_permissions\"><code class=\"xref py py-meth docutils literal notranslate\">get_group_permissions()</code></a> method.</p></li>\n<li><p>Added HTML <code class=\"docutils literal notranslate\">autocomplete</code> attribute to widgets of username, email, and\npassword fields in <a class=\"reference internal\" href=\"/en/dev/topics/auth/default/#module-django.contrib.auth.forms\" title=\"django.contrib.auth.forms\"><code class=\"xref py py-mod docutils literal notranslate\">django.contrib.auth.forms</code></a> for better interaction\nwith browser password managers.</p></li>\n<li><p><a class=\"reference internal\" href=\"/en/dev/ref/django-admin/#django-admin-createsuperuser\"><code class=\"xref std std-djadmin docutils literal notranslate\">createsuperuser</code></a> now falls back to environment variables for\npassword and required fields, when a corresponding command line argument\nisn’t provided in non-interactive mode.</p></li>\n<li><p><a class=\"reference internal\" href=\"/en/dev/topics/auth/customizing/#django.contrib.auth.models.CustomUser.REQUIRED_FIELDS\" title=\"django.contrib.auth.models.CustomUser.REQUIRED_FIELDS\"><code class=\"xref py py-attr docutils literal notranslate\">REQUIRED_FIELDS</code></a> now supports\n<a class=\"reference internal\" href=\"/en/dev/ref/models/fields/#django.db.models.ManyToManyField\" title=\"django.db.models.ManyToManyField\"><code class=\"xref py py-class docutils literal notranslate\">ManyToManyField</code></a>s.</p></li>\n<li><p>The new <a class=\"reference internal\" href=\"/en/dev/ref/contrib/auth/#django.contrib.auth.models.UserManager.with_perm\" title=\"django.contrib.auth.models.UserManager.with_perm\"><code class=\"xref py py-meth docutils literal notranslate\">UserManager.with_perm()</code></a> method returns users that have the\nspecified permission.</p></li>\n<li><p>The default iteration count for the PBKDF2 password hasher is increased from\n150,000 to 180,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>Allowed MySQL spatial lookup functions to operate on real geometries.\nPrevious support was limited to bounding boxes.</p></li>\n<li><p>Added the <a class=\"reference internal\" href=\"/en/dev/ref/contrib/gis/functions/#django.contrib.gis.db.models.functions.GeometryDistance\" title=\"django.contrib.gis.db.models.functions.GeometryDistance\"><code class=\"xref py py-class docutils literal notranslate\">GeometryDistance</code></a>\nfunction, supported on PostGIS.</p></li>\n<li><p>Added support for the <code class=\"docutils literal notranslate\">furlong</code> unit in\n<a class=\"reference internal\" href=\"/en/dev/ref/contrib/gis/measure/#django.contrib.gis.measure.Distance\" title=\"django.contrib.gis.measure.Distance\"><code class=\"xref py py-class docutils literal notranslate\">Distance</code></a>.</p></li>\n<li><p>The <a class=\"reference internal\" href=\"/en/dev/ref/contrib/gis/geoip2/#std-setting-GEOIP_PATH\"><code class=\"xref std std-setting docutils literal notranslate\">GEOIP_PATH</code></a> setting now supports <a class=\"reference external\" href=\"https://docs.python.org/3/library/pathlib.html#pathlib.Path\" title=\"(in Python v3.14)\"><code class=\"xref py py-class docutils literal notranslate\">pathlib.Path</code></a>.</p></li>\n<li><p>The <a class=\"reference internal\" href=\"/en/dev/ref/contrib/gis/geoip2/#django.contrib.gis.geoip2.GeoIP2\" title=\"django.contrib.gis.geoip2.GeoIP2\"><code class=\"xref py py-class docutils literal notranslate\">GeoIP2</code></a> class now accepts\n<a class=\"reference external\" href=\"https://docs.python.org/3/library/pathlib.html#pathlib.Path\" title=\"(in Python v3.14)\"><code class=\"xref py py-class docutils literal notranslate\">pathlib.Path</code></a> <code class=\"docutils literal notranslate\">path</code>.</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/fields/#django.contrib.postgres.fields.RangeOperators\" title=\"django.contrib.postgres.fields.RangeOperators\"><code class=\"xref py py-class docutils literal notranslate\">RangeOperators</code></a> helps to\navoid typos in SQL operators that can be used together with\n<a class=\"reference internal\" href=\"/en/dev/ref/contrib/postgres/fields/#django.contrib.postgres.fields.RangeField\" title=\"django.contrib.postgres.fields.RangeField\"><code class=\"xref py py-class docutils literal notranslate\">RangeField</code></a>.</p></li>\n<li><p>The new <a class=\"reference internal\" href=\"/en/dev/ref/contrib/postgres/fields/#django.contrib.postgres.fields.RangeBoundary\" title=\"django.contrib.postgres.fields.RangeBoundary\"><code class=\"xref py py-class docutils literal notranslate\">RangeBoundary</code></a> expression\nrepresents the range boundaries.</p></li>\n<li><p>The new <a class=\"reference internal\" href=\"/en/dev/ref/contrib/postgres/operations/#django.contrib.postgres.operations.AddIndexConcurrently\" title=\"django.contrib.postgres.operations.AddIndexConcurrently\"><code class=\"xref py py-class docutils literal notranslate\">AddIndexConcurrently</code></a>\nand <a class=\"reference internal\" href=\"/en/dev/ref/contrib/postgres/operations/#django.contrib.postgres.operations.RemoveIndexConcurrently\" title=\"django.contrib.postgres.operations.RemoveIndexConcurrently\"><code class=\"xref py py-class docutils literal notranslate\">RemoveIndexConcurrently</code></a>\nclasses allow creating and dropping indexes <code class=\"docutils literal notranslate\">CONCURRENTLY</code> on PostgreSQL.</p></li>\n</ul>\n</section>\n<section id=\"django-contrib-sessions\">\n<h4><a class=\"reference internal\" href=\"/en/dev/topics/http/sessions/#module-django.contrib.sessions\" title=\"django.contrib.sessions: Provides session management for Django projects.\"><code class=\"xref py py-mod docutils literal notranslate\">django.contrib.sessions</code></a><a class=\"heading-anchor\" href=\"#django-contrib-sessions\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h4>\n<ul class=\"simple\">\n<li><p>The new\n<a class=\"reference internal\" href=\"/en/dev/topics/http/sessions/#django.contrib.sessions.backends.base.SessionBase.get_session_cookie_age\" title=\"django.contrib.sessions.backends.base.SessionBase.get_session_cookie_age\"><code class=\"xref py py-meth docutils literal notranslate\">get_session_cookie_age()</code></a>\nmethod allows dynamically specifying the session cookie age.</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>Added the <code class=\"docutils literal notranslate\">language</code> class attribute to the\n<a class=\"reference internal\" href=\"/en/dev/ref/contrib/syndication/#django.contrib.syndication.views.Feed\" title=\"django.contrib.syndication.views.Feed\"><code class=\"xref py py-class docutils literal notranslate\">django.contrib.syndication.views.Feed</code></a> to customize a feed language.\nThe default value is <a class=\"reference internal\" href=\"/en/dev/ref/utils/#django.utils.translation.get_language\" title=\"django.utils.translation.get_language\"><code class=\"xref py py-func docutils literal notranslate\">get_language()</code></a> instead\nof <a class=\"reference internal\" href=\"/en/dev/ref/settings/#std-setting-LANGUAGE_CODE\"><code class=\"xref std std-setting docutils literal notranslate\">LANGUAGE_CODE</code></a>.</p></li>\n</ul>\n</section>\n<section id=\"cache\">\n<h4>Cache<a class=\"heading-anchor\" href=\"#cache\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h4>\n<ul class=\"simple\">\n<li><p><a class=\"reference internal\" href=\"/en/dev/ref/utils/#django.utils.cache.add_never_cache_headers\" title=\"django.utils.cache.add_never_cache_headers\"><code class=\"xref py py-func docutils literal notranslate\">add_never_cache_headers()</code></a> and\n<a class=\"reference internal\" href=\"/en/dev/topics/http/decorators/#django.views.decorators.cache.never_cache\" title=\"django.views.decorators.cache.never_cache\"><code class=\"xref py py-func docutils literal notranslate\">never_cache()</code></a> now add the <code class=\"docutils literal notranslate\">private</code>\ndirective to <code class=\"docutils literal notranslate\">Cache-Control</code> headers.</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>The new <a class=\"reference internal\" href=\"/en/dev/ref/files/storage/#django.core.files.storage.Storage.get_alternative_name\" title=\"django.core.files.storage.Storage.get_alternative_name\"><code class=\"xref py py-meth docutils literal notranslate\">Storage.get_alternative_name()</code></a> method allows customizing the\nalgorithm for generating filenames if a file with the uploaded name already\nexists.</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>Formsets may control the widget used when ordering forms via\n<a class=\"reference internal\" href=\"/en/dev/topics/forms/formsets/#django.forms.formsets.BaseFormSet.can_order\" title=\"django.forms.formsets.BaseFormSet.can_order\"><code class=\"xref py py-attr docutils literal notranslate\">can_order</code></a> by setting the\n<a class=\"reference internal\" href=\"/en/dev/topics/forms/formsets/#django.forms.formsets.BaseFormSet.ordering_widget\" title=\"django.forms.formsets.BaseFormSet.ordering_widget\"><code class=\"xref py py-attr docutils literal notranslate\">ordering_widget</code></a> attribute or\noverriding <a class=\"reference internal\" href=\"/en/dev/topics/forms/formsets/#django.forms.formsets.BaseFormSet.get_ordering_widget\" title=\"django.forms.formsets.BaseFormSet.get_ordering_widget\"><code class=\"xref py py-attr docutils literal notranslate\">get_ordering_widget</code></a>.</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 the <a class=\"reference internal\" href=\"/en/dev/ref/settings/#std-setting-LANGUAGE_COOKIE_HTTPONLY\"><code class=\"xref std std-setting docutils literal notranslate\">LANGUAGE_COOKIE_HTTPONLY</code></a>,\n<a class=\"reference internal\" href=\"/en/dev/ref/settings/#std-setting-LANGUAGE_COOKIE_SAMESITE\"><code class=\"xref std std-setting docutils literal notranslate\">LANGUAGE_COOKIE_SAMESITE</code></a>, and <a class=\"reference internal\" href=\"/en/dev/ref/settings/#std-setting-LANGUAGE_COOKIE_SECURE\"><code class=\"xref std std-setting docutils literal notranslate\">LANGUAGE_COOKIE_SECURE</code></a>\nsettings to set the <code class=\"docutils literal notranslate\">HttpOnly</code>, <code class=\"docutils literal notranslate\">SameSite</code>, and <code class=\"docutils literal notranslate\">Secure</code> flags on\nlanguage cookies. The default values of these settings preserve the previous\nbehavior.</p></li>\n<li><p>Added support and translations for the Uzbek language.</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>The new <code class=\"docutils literal notranslate\">reporter_class</code> parameter of\n<a class=\"reference internal\" href=\"/en/dev/ref/logging/#django.utils.log.AdminEmailHandler\" title=\"django.utils.log.AdminEmailHandler\"><code class=\"xref py py-class docutils literal notranslate\">AdminEmailHandler</code></a> allows providing an\n<code class=\"docutils literal notranslate\">django.views.debug.ExceptionReporter</code> subclass to customize the traceback\ntext sent to site <a class=\"reference internal\" href=\"/en/dev/ref/settings/#std-setting-ADMINS\"><code class=\"xref std std-setting docutils literal notranslate\">ADMINS</code></a> when <a class=\"reference internal\" href=\"/en/dev/ref/settings/#std-setting-DEBUG\"><code class=\"xref std std-setting docutils literal notranslate\">DEBUG</code></a> is <code class=\"docutils literal notranslate\">False</code>.</p></li>\n</ul>\n</section>\n<section id=\"management-commands\">\n<h4>Management Commands<a class=\"heading-anchor\" href=\"#management-commands\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h4>\n<ul class=\"simple\">\n<li><p>The new <a class=\"reference internal\" href=\"/en/dev/ref/django-admin/#cmdoption-compilemessages-ignore\"><code class=\"xref std std-option docutils literal notranslate\">compilemessages --ignore</code></a> option allows ignoring specific\ndirectories when searching for <code class=\"docutils literal notranslate\">.po</code> files to compile.</p></li>\n<li><p><a class=\"reference internal\" href=\"/en/dev/ref/django-admin/#cmdoption-showmigrations-list\"><code class=\"xref std std-option docutils literal notranslate\">showmigrations --list</code></a> now shows the applied datetimes when\n<code class=\"docutils literal notranslate\">--verbosity</code> is 2 and above.</p></li>\n<li><p>On PostgreSQL, <a class=\"reference internal\" href=\"/en/dev/ref/django-admin/#django-admin-dbshell\"><code class=\"xref std std-djadmin docutils literal notranslate\">dbshell</code></a> now supports client-side TLS certificates.</p></li>\n<li><p><a class=\"reference internal\" href=\"/en/dev/ref/django-admin/#django-admin-inspectdb\"><code class=\"xref std std-djadmin docutils literal notranslate\">inspectdb</code></a> now introspects <a class=\"reference internal\" href=\"/en/dev/ref/models/fields/#django.db.models.OneToOneField\" title=\"django.db.models.OneToOneField\"><code class=\"xref py py-class docutils literal notranslate\">OneToOneField</code></a>\nwhen a foreign key has a unique or primary key constraint.</p></li>\n<li><p>The new <a class=\"reference internal\" href=\"/en/dev/ref/django-admin/#cmdoption-skip-checks\"><code class=\"xref std std-option docutils literal notranslate\">--skip-checks</code></a> option skips running system checks prior to\nrunning the command.</p></li>\n<li><p>The <a class=\"reference internal\" href=\"/en/dev/ref/django-admin/#cmdoption-startapp-template\"><code class=\"xref std std-option docutils literal notranslate\">startapp --template</code></a> and <a class=\"reference internal\" href=\"/en/dev/ref/django-admin/#cmdoption-startproject-template\"><code class=\"xref std std-option docutils literal notranslate\">startproject --template</code></a>\noptions now support templates stored in XZ archives (<code class=\"docutils literal notranslate\">.tar.xz</code>, <code class=\"docutils literal notranslate\">.txz</code>)\nand LZMA archives (<code class=\"docutils literal notranslate\">.tar.lzma</code>, <code class=\"docutils literal notranslate\">.tlz</code>).</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>\n<li><p>Added hash database functions <a class=\"reference internal\" href=\"/en/dev/ref/models/database-functions/#django.db.models.functions.MD5\" title=\"django.db.models.functions.MD5\"><code class=\"xref py py-class docutils literal notranslate\">MD5</code></a>,\n<a class=\"reference internal\" href=\"/en/dev/ref/models/database-functions/#django.db.models.functions.SHA1\" title=\"django.db.models.functions.SHA1\"><code class=\"xref py py-class docutils literal notranslate\">SHA1</code></a>,\n<a class=\"reference internal\" href=\"/en/dev/ref/models/database-functions/#django.db.models.functions.SHA224\" title=\"django.db.models.functions.SHA224\"><code class=\"xref py py-class docutils literal notranslate\">SHA224</code></a>,\n<a class=\"reference internal\" href=\"/en/dev/ref/models/database-functions/#django.db.models.functions.SHA256\" title=\"django.db.models.functions.SHA256\"><code class=\"xref py py-class docutils literal notranslate\">SHA256</code></a>,\n<a class=\"reference internal\" href=\"/en/dev/ref/models/database-functions/#django.db.models.functions.SHA384\" title=\"django.db.models.functions.SHA384\"><code class=\"xref py py-class docutils literal notranslate\">SHA384</code></a>, and\n<a class=\"reference internal\" href=\"/en/dev/ref/models/database-functions/#django.db.models.functions.SHA512\" title=\"django.db.models.functions.SHA512\"><code class=\"xref py py-class docutils literal notranslate\">SHA512</code></a>.</p></li>\n<li><p>Added the <a class=\"reference internal\" href=\"/en/dev/ref/models/database-functions/#django.db.models.functions.Sign\" title=\"django.db.models.functions.Sign\"><code class=\"xref py py-class docutils literal notranslate\">Sign</code></a> database function.</p></li>\n<li><p>The new <code class=\"docutils literal notranslate\">is_dst</code>  parameter of the\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 determines the\ntreatment of nonexistent and ambiguous datetimes.</p></li>\n<li><p><code class=\"docutils literal notranslate\">connection.queries</code> now shows <code class=\"docutils literal notranslate\">COPY … TO</code> statements on PostgreSQL.</p></li>\n<li><p><a class=\"reference internal\" href=\"/en/dev/ref/models/fields/#django.db.models.FilePathField\" title=\"django.db.models.FilePathField\"><code class=\"xref py py-class docutils literal notranslate\">FilePathField</code></a> now accepts a callable for <code class=\"docutils literal notranslate\">path</code>.</p></li>\n<li><p>Allowed symmetrical intermediate table for self-referential\n<a class=\"reference internal\" href=\"/en/dev/ref/models/fields/#django.db.models.ManyToManyField\" title=\"django.db.models.ManyToManyField\"><code class=\"xref py py-class docutils literal notranslate\">ManyToManyField</code></a>.</p></li>\n<li><p>The <code class=\"docutils literal notranslate\">name</code> attributes of <a class=\"reference internal\" href=\"/en/dev/ref/models/constraints/#django.db.models.CheckConstraint\" title=\"django.db.models.CheckConstraint\"><code class=\"xref py py-class docutils literal notranslate\">CheckConstraint</code></a>,\n<a class=\"reference internal\" href=\"/en/dev/ref/models/constraints/#django.db.models.UniqueConstraint\" title=\"django.db.models.UniqueConstraint\"><code class=\"xref py py-class docutils literal notranslate\">UniqueConstraint</code></a>, and\n<a class=\"reference internal\" href=\"/en/dev/ref/models/indexes/#django.db.models.Index\" title=\"django.db.models.Index\"><code class=\"xref py py-class docutils literal notranslate\">Index</code></a> now support app label and class\ninterpolation using the <code class=\"docutils literal notranslate\">'%(app_label)s'</code> and <code class=\"docutils literal notranslate\">'%(class)s'</code> placeholders.</p></li>\n<li><p>The new <a class=\"reference internal\" href=\"/en/dev/ref/models/fields/#django.db.models.Field.descriptor_class\" title=\"django.db.models.Field.descriptor_class\"><code class=\"xref py py-attr docutils literal notranslate\">Field.descriptor_class</code></a> attribute allows model fields to\ncustomize the get and set behavior by overriding their\n<a class=\"reference external\" href=\"https://docs.python.org/3/reference/datamodel.html#descriptors\" title=\"(in Python v3.14)\"><span class=\"xref std std-ref\">descriptors</span></a>.</p></li>\n<li><p><a class=\"reference internal\" href=\"/en/dev/ref/models/querysets/#django.db.models.Avg\" title=\"django.db.models.Avg\"><code class=\"xref py py-class docutils literal notranslate\">Avg</code></a> and <a class=\"reference internal\" href=\"/en/dev/ref/models/querysets/#django.db.models.Sum\" title=\"django.db.models.Sum\"><code class=\"xref py py-class docutils literal notranslate\">Sum</code></a> now support\nthe <code class=\"docutils literal notranslate\">distinct</code> argument.</p></li>\n<li><p>Added <a class=\"reference internal\" href=\"/en/dev/ref/models/fields/#django.db.models.SmallAutoField\" title=\"django.db.models.SmallAutoField\"><code class=\"xref py py-class docutils literal notranslate\">SmallAutoField</code></a> which acts much like an\n<a class=\"reference internal\" href=\"/en/dev/ref/models/fields/#django.db.models.AutoField\" title=\"django.db.models.AutoField\"><code class=\"xref py py-class docutils literal notranslate\">AutoField</code></a> except that it only allows values under\na certain (database-dependent) limit. Values from <code class=\"docutils literal notranslate\">1</code> to <code class=\"docutils literal notranslate\">32767</code> are safe\nin all databases supported by Django.</p></li>\n<li><p><a class=\"reference internal\" href=\"/en/dev/ref/models/fields/#django.db.models.AutoField\" title=\"django.db.models.AutoField\"><code class=\"xref py py-class docutils literal notranslate\">AutoField</code></a>,\n<a class=\"reference internal\" href=\"/en/dev/ref/models/fields/#django.db.models.BigAutoField\" title=\"django.db.models.BigAutoField\"><code class=\"xref py py-class docutils literal notranslate\">BigAutoField</code></a>, and\n<a class=\"reference internal\" href=\"/en/dev/ref/models/fields/#django.db.models.SmallAutoField\" title=\"django.db.models.SmallAutoField\"><code class=\"xref py py-class docutils literal notranslate\">SmallAutoField</code></a> now inherit from\n<code class=\"docutils literal notranslate\">IntegerField</code>, <code class=\"docutils literal notranslate\">BigIntegerField</code> and <code class=\"docutils literal notranslate\">SmallIntegerField</code> respectively.\nSystem checks and validators are now also properly inherited.</p></li>\n<li><p><a class=\"reference internal\" href=\"/en/dev/ref/models/fields/#django.db.models.FileField.upload_to\" title=\"django.db.models.FileField.upload_to\"><code class=\"xref py py-attr docutils literal notranslate\">FileField.upload_to</code></a> now supports <a class=\"reference external\" href=\"https://docs.python.org/3/library/pathlib.html#pathlib.Path\" title=\"(in Python v3.14)\"><code class=\"xref py py-class docutils literal notranslate\">pathlib.Path</code></a>.</p></li>\n<li><p><a class=\"reference internal\" href=\"/en/dev/ref/models/constraints/#django.db.models.CheckConstraint\" title=\"django.db.models.CheckConstraint\"><code class=\"xref py py-class docutils literal notranslate\">CheckConstraint</code></a> is now supported on MySQL 8.0.16+.</p></li>\n<li><p>The new <code class=\"docutils literal notranslate\">allows_group_by_selected_pks_on_model()</code> method of\n<code class=\"docutils literal notranslate\">django.db.backends.base.BaseDatabaseFeatures</code> allows optimization of\n<code class=\"docutils literal notranslate\">GROUP BY</code> clauses to require only the selected models’ primary keys. By\ndefault, it’s supported only for managed models on PostgreSQL.</p>\n<p>To enable the <code class=\"docutils literal notranslate\">GROUP BY</code> primary key-only optimization for unmanaged\nmodels, you have to subclass the PostgreSQL database engine, overriding the\nfeatures class <code class=\"docutils literal notranslate\">allows_group_by_selected_pks_on_model()</code> method as you\nrequire. See <a class=\"reference internal\" href=\"/en/dev/ref/databases/#subclassing-database-backends\"><span class=\"std std-ref\">Subclassing the built-in database backends</span></a> for an example.</p>\n</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>Allowed <a class=\"reference internal\" href=\"/en/dev/ref/request-response/#django.http.HttpResponse\" title=\"django.http.HttpResponse\"><code class=\"xref py py-class docutils literal notranslate\">HttpResponse</code></a> to be initialized with\n<a class=\"reference external\" href=\"https://docs.python.org/3/library/stdtypes.html#memoryview\" title=\"(in Python v3.14)\"><code class=\"xref py py-class docutils literal notranslate\">memoryview</code></a> content.</p></li>\n<li><p>For use in, for example, Django templates, <a class=\"reference internal\" href=\"/en/dev/ref/request-response/#django.http.HttpRequest.headers\" title=\"django.http.HttpRequest.headers\"><code class=\"xref py py-attr docutils literal notranslate\">HttpRequest.headers</code></a> now\nallows lookups using underscores (e.g. <code class=\"docutils literal notranslate\">user_agent</code>) in place of hyphens.</p></li>\n</ul>\n</section>\n<section id=\"security\">\n<span id=\"whats-new-security-3-0\"></span><h4>Security<a class=\"heading-anchor\" href=\"#security\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h4>\n<ul class=\"simple\">\n<li><p><a class=\"reference internal\" href=\"/en/dev/ref/settings/#std-setting-X_FRAME_OPTIONS\"><code class=\"xref std std-setting docutils literal notranslate\">X_FRAME_OPTIONS</code></a> now defaults to <code class=\"docutils literal notranslate\">'DENY'</code>. In older versions, the\n<a class=\"reference internal\" href=\"/en/dev/ref/settings/#std-setting-X_FRAME_OPTIONS\"><code class=\"xref std std-setting docutils literal notranslate\">X_FRAME_OPTIONS</code></a> setting defaults to <code class=\"docutils literal notranslate\">'SAMEORIGIN'</code>. If your site\nuses frames of itself, you will need to explicitly set <code class=\"docutils literal notranslate\">X_FRAME_OPTIONS =\n'SAMEORIGIN'</code> for them to continue working.</p></li>\n<li><p><a class=\"reference internal\" href=\"/en/dev/ref/settings/#std-setting-SECURE_CONTENT_TYPE_NOSNIFF\"><code class=\"xref std std-setting docutils literal notranslate\">SECURE_CONTENT_TYPE_NOSNIFF</code></a> now defaults to <code class=\"docutils literal notranslate\">True</code>. With this\nenabled, <a class=\"reference internal\" href=\"/en/dev/ref/middleware/#django.middleware.security.SecurityMiddleware\" title=\"django.middleware.security.SecurityMiddleware\"><code class=\"xref py py-class docutils literal notranslate\">SecurityMiddleware</code></a> sets the\n<a class=\"reference internal\" href=\"/en/dev/ref/middleware/#x-content-type-options\"><span class=\"std std-ref\">X-Content-Type-Options: nosniff</span></a> header on all responses that do not already\nhave it.</p></li>\n<li><p><a class=\"reference internal\" href=\"/en/dev/ref/middleware/#django.middleware.security.SecurityMiddleware\" title=\"django.middleware.security.SecurityMiddleware\"><code class=\"xref py py-class docutils literal notranslate\">SecurityMiddleware</code></a> can now send the\n<a class=\"reference internal\" href=\"/en/dev/ref/middleware/#referrer-policy\"><span class=\"std std-ref\">Referrer-Policy</span></a> header.</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 new test <a class=\"reference internal\" href=\"/en/dev/topics/testing/tools/#django.test.Client\" title=\"django.test.Client\"><code class=\"xref py py-class docutils literal notranslate\">Client</code></a> argument\n<code class=\"docutils literal notranslate\">raise_request_exception</code> allows controlling whether or not exceptions\nraised during the request should also be raised in the test. The value\ndefaults to <code class=\"docutils literal notranslate\">True</code> for backwards compatibility. If it is <code class=\"docutils literal notranslate\">False</code> and an\nexception occurs, the test client will return a 500 response with the\nattribute <a class=\"reference internal\" href=\"/en/dev/topics/testing/tools/#django.test.Response.exc_info\" title=\"django.test.Response.exc_info\"><code class=\"xref py py-attr docutils literal notranslate\">exc_info</code></a>, a tuple providing\ninformation of the exception that occurred.</p></li>\n<li><p>Tests and test cases to run can be selected by test name pattern using the\nnew <a class=\"reference internal\" href=\"/en/dev/ref/django-admin/#cmdoption-test-k\"><code class=\"xref std std-option docutils literal notranslate\">test -k</code></a> option.</p></li>\n<li><p>HTML comparison, as used by\n<a class=\"reference internal\" href=\"/en/dev/topics/testing/tools/#django.test.SimpleTestCase.assertHTMLEqual\" title=\"django.test.SimpleTestCase.assertHTMLEqual\"><code class=\"xref py py-meth docutils literal notranslate\">assertHTMLEqual()</code></a>, now treats text,\ncharacter references, and entity references that refer to the same character\nas equivalent.</p></li>\n<li><p><a class=\"reference internal\" href=\"/en/dev/topics/testing/advanced/#django.test.runner.DiscoverRunner\" title=\"django.test.runner.DiscoverRunner\"><code class=\"xref py py-class docutils literal notranslate\">DiscoverRunner</code></a> can now spawn a debugger at each\nerror or failure using the <a class=\"reference internal\" href=\"/en/dev/ref/django-admin/#cmdoption-test-pdb\"><code class=\"xref std std-option docutils literal notranslate\">test --pdb</code></a> option.</p></li>\n</ul>\n</section>\n</section>\n</section>\n<section id=\"backwards-incompatible-changes-in-3-0\">\n<span id=\"backwards-incompatible-3-0\"></span><h2>Backwards incompatible changes in 3.0<a class=\"heading-anchor\" href=\"#backwards-incompatible-changes-in-3-0\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h2>\n<section id=\"model-save-when-providing-a-default-for-the-primary-key\">\n<h3><code class=\"docutils literal notranslate\">Model.save()</code> when providing a default for the primary key<a class=\"heading-anchor\" href=\"#model-save-when-providing-a-default-for-the-primary-key\"><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/ref/models/instances/#django.db.models.Model.save\" title=\"django.db.models.Model.save\"><code class=\"xref py py-meth docutils literal notranslate\">Model.save()</code></a> no longer attempts to find a row when saving a new\n<code class=\"docutils literal notranslate\">Model</code> instance and a default value for the primary key is provided, and\nalways performs a single <code class=\"docutils literal notranslate\">INSERT</code> query. In older Django versions,\n<code class=\"docutils literal notranslate\">Model.save()</code> performed either an <code class=\"docutils literal notranslate\">INSERT</code> or an <code class=\"docutils literal notranslate\">UPDATE</code> based on\nwhether or not the row exists.</p>\n<p>This makes calling <code class=\"docutils literal notranslate\">Model.save()</code> while providing a default primary key value\nequivalent to passing <a class=\"reference internal\" href=\"/en/dev/ref/models/instances/#ref-models-force-insert\"><span class=\"std std-ref\">force_insert=True</span></a> to\nmodel’s <code class=\"docutils literal notranslate\">save()</code>. Attempts to use a new <code class=\"docutils literal notranslate\">Model</code> instance to update an\nexisting row will result in an <code class=\"docutils literal notranslate\">IntegrityError</code>.</p>\n<p>In order to update an existing model for a specific primary key value, use the\n<a class=\"reference internal\" href=\"/en/dev/ref/models/querysets/#django.db.models.query.QuerySet.update_or_create\" title=\"django.db.models.query.QuerySet.update_or_create\"><code class=\"xref py py-meth docutils literal notranslate\">update_or_create()</code></a> method or\n<code class=\"docutils literal notranslate\">QuerySet.filter(pk=…).update(…)</code> instead. For example:</p>\n<div class=\"code-block\" data-language=\"pycon\"><div class=\"code-block-toolbar\"><span class=\"code-block-language\">Python console</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=\"Python console code\"><code><span class=\"gp\">&gt;&gt;&gt; </span>MyModel<span class=\"o\">.</span>objects<span class=\"o\">.</span>update_or_create<span class=\"p\">(</span>pk<span class=\"o\">=</span>existing_pk<span class=\"p\">,</span> defaults<span class=\"o\">=</span><span class=\"p\">{</span><span class=\"s2\">&quot;name&quot;</span><span class=\"p\">:</span> <span class=\"s2\">&quot;new name&quot;</span><span class=\"p\">})</span>\n<span class=\"gp\">&gt;&gt;&gt; </span>MyModel<span class=\"o\">.</span>objects<span class=\"o\">.</span>filter<span class=\"p\">(</span>pk<span class=\"o\">=</span>existing_pk<span class=\"p\">)</span><span class=\"o\">.</span>update<span class=\"p\">(</span>name<span class=\"o\">=</span><span class=\"s2\">&quot;new name&quot;</span><span class=\"p\">)</span>\n</code></pre></div>\n</section>\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>The second argument of <code class=\"docutils literal notranslate\">DatabaseIntrospection.get_geometry_type()</code> is now\nthe row description instead of the column name.</p></li>\n<li><p><code class=\"docutils literal notranslate\">DatabaseIntrospection.get_field_type()</code> may no longer return tuples.</p></li>\n<li><p>If the database can create foreign keys in the same SQL statement that adds a\nfield, add <code class=\"docutils literal notranslate\">SchemaEditor.sql_create_column_inline_fk</code> with the appropriate\nSQL; otherwise, set <code class=\"docutils literal notranslate\">DatabaseFeatures.can_create_inline_fk = False</code>.</p></li>\n<li><p><code class=\"docutils literal notranslate\">DatabaseFeatures.can_return_id_from_insert</code> and\n<code class=\"docutils literal notranslate\">can_return_ids_from_bulk_insert</code> are renamed to\n<code class=\"docutils literal notranslate\">can_return_columns_from_insert</code> and <code class=\"docutils literal notranslate\">can_return_rows_from_bulk_insert</code>.</p></li>\n<li><p>Database functions now handle <a class=\"reference external\" href=\"https://docs.python.org/3/library/datetime.html#datetime.timezone\" title=\"(in Python v3.14)\"><code class=\"xref py py-class docutils literal notranslate\">datetime.timezone</code></a> formats when created\nusing <a class=\"reference external\" href=\"https://docs.python.org/3/library/datetime.html#datetime.timedelta\" title=\"(in Python v3.14)\"><code class=\"xref py py-class docutils literal notranslate\">datetime.timedelta</code></a> instances (e.g.\n<code class=\"docutils literal notranslate\">timezone(timedelta(hours=5))</code>, which would output <code class=\"docutils literal notranslate\">'UTC+05:00'</code>).\nThird-party backends should handle this format when preparing\n<a class=\"reference internal\" href=\"/en/dev/ref/models/fields/#django.db.models.DateTimeField\" title=\"django.db.models.DateTimeField\"><code class=\"xref py py-class docutils literal notranslate\">DateTimeField</code></a> in <code class=\"docutils literal notranslate\">datetime_cast_date_sql()</code>,\n<code class=\"docutils literal notranslate\">datetime_extract_sql()</code>, etc.</p></li>\n<li><p>Entries for <code class=\"docutils literal notranslate\">AutoField</code>, <code class=\"docutils literal notranslate\">BigAutoField</code>, and <code class=\"docutils literal notranslate\">SmallAutoField</code> are added\nto  <code class=\"docutils literal notranslate\">DatabaseOperations.integer_field_ranges</code> to support the integer range\nvalidators on these field types. Third-party backends may need to customize\nthe default entries.</p></li>\n<li><p><code class=\"docutils literal notranslate\">DatabaseOperations.fetch_returned_insert_id()</code> is replaced by\n<code class=\"docutils literal notranslate\">fetch_returned_insert_columns()</code> which returns a list of values returned\nby the <code class=\"docutils literal notranslate\">INSERT … RETURNING</code> statement, instead of a single value.</p></li>\n<li><p><code class=\"docutils literal notranslate\">DatabaseOperations.return_insert_id()</code> is replaced by\n<code class=\"docutils literal notranslate\">return_insert_columns()</code> that accepts a <code class=\"docutils literal notranslate\">fields</code>\nargument, which is an iterable of fields to be returned after insert. Usually\nthis is only the auto-generated primary key.</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>Admin’s model history change messages now prefers more readable field labels\ninstead of field names.</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>Support for PostGIS 2.1 is removed.</p></li>\n<li><p>Support for SpatiaLite 4.1 and 4.2 is removed.</p></li>\n<li><p>Support for GDAL 1.11 and GEOS 3.4 is removed.</p></li>\n</ul>\n</section>\n<section id=\"dropped-support-for-postgresql-9-4\">\n<h3>Dropped support for PostgreSQL 9.4<a class=\"heading-anchor\" href=\"#dropped-support-for-postgresql-9-4\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h3>\n<p>Upstream support for PostgreSQL 9.4 ends in December 2019. Django 3.0 supports\nPostgreSQL 9.5 and higher.</p>\n</section>\n<section id=\"dropped-support-for-oracle-12-1\">\n<h3>Dropped support for Oracle 12.1<a class=\"heading-anchor\" href=\"#dropped-support-for-oracle-12-1\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h3>\n<p>Upstream support for Oracle 12.1 ends in July 2021. Django 2.2 will be\nsupported until April 2022. Django 3.0 officially supports Oracle 12.2 and 18c.</p>\n</section>\n<section id=\"removed-private-python-2-compatibility-apis\">\n<h3>Removed private Python 2 compatibility APIs<a class=\"heading-anchor\" href=\"#removed-private-python-2-compatibility-apis\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h3>\n<p>While Python 2 support was removed in Django 2.0, some private APIs weren’t\nremoved from Django so that third party apps could continue using them until\nthe Python 2 end-of-life.</p>\n<p>Since we expect apps to drop Python 2 compatibility when adding support for\nDjango 3.0, we’re removing these APIs at this time.</p>\n<ul class=\"simple\">\n<li><p><code class=\"docutils literal notranslate\">django.test.utils.str_prefix()</code> - Strings don’t have ‘u’ prefixes in\nPython 3.</p></li>\n<li><p><code class=\"docutils literal notranslate\">django.test.utils.patch_logger()</code> - Use\n<a class=\"reference external\" href=\"https://docs.python.org/3/library/unittest.html#unittest.TestCase.assertLogs\" title=\"(in Python v3.14)\"><code class=\"xref py py-meth docutils literal notranslate\">unittest.TestCase.assertLogs()</code></a> instead.</p></li>\n<li><p><code class=\"docutils literal notranslate\">django.utils.lru_cache.lru_cache()</code> - Alias of\n<a class=\"reference external\" href=\"https://docs.python.org/3/library/functools.html#functools.lru_cache\" title=\"(in Python v3.14)\"><code class=\"xref py py-func docutils literal notranslate\">functools.lru_cache()</code></a>.</p></li>\n<li><p><code class=\"docutils literal notranslate\">django.utils.decorators.available_attrs()</code> - This function returns\n<code class=\"docutils literal notranslate\">functools.WRAPPER_ASSIGNMENTS</code>.</p></li>\n<li><p><code class=\"docutils literal notranslate\">django.utils.decorators.ContextDecorator</code> - Alias of\n<a class=\"reference external\" href=\"https://docs.python.org/3/library/contextlib.html#contextlib.ContextDecorator\" title=\"(in Python v3.14)\"><code class=\"xref py py-class docutils literal notranslate\">contextlib.ContextDecorator</code></a>.</p></li>\n<li><p><code class=\"docutils literal notranslate\">django.utils._os.abspathu()</code> - Alias of <a class=\"reference external\" href=\"https://docs.python.org/3/library/os.path.html#os.path.abspath\" title=\"(in Python v3.14)\"><code class=\"xref py py-func docutils literal notranslate\">os.path.abspath()</code></a>.</p></li>\n<li><p><code class=\"docutils literal notranslate\">django.utils._os.upath()</code> and <code class=\"docutils literal notranslate\">npath()</code> - These functions do nothing on\nPython 3.</p></li>\n<li><p><code class=\"docutils literal notranslate\">django.utils.six</code> - Remove usage of this vendored library or switch to\n<a class=\"extlink-pypi reference external\" href=\"https://pypi.org/project/six/\">six</a>.</p></li>\n<li><p><code class=\"docutils literal notranslate\">django.utils.encoding.python_2_unicode_compatible()</code> - Alias of\n<code class=\"docutils literal notranslate\">six.python_2_unicode_compatible()</code>.</p></li>\n<li><p><code class=\"docutils literal notranslate\">django.utils.functional.curry()</code> - Use <a class=\"reference external\" href=\"https://docs.python.org/3/library/functools.html#functools.partial\" title=\"(in Python v3.14)\"><code class=\"xref py py-func docutils literal notranslate\">functools.partial()</code></a> or\n<a class=\"reference external\" href=\"https://docs.python.org/3/library/functools.html#functools.partialmethod\" title=\"(in Python v3.14)\"><code class=\"xref py py-class docutils literal notranslate\">functools.partialmethod</code></a>. See\n<a class=\"extlink-commit reference external\" href=\"https://github.com/django/django/commit/5b1c389603a353625ae1603ba345147356336afb\">5b1c389603a353625ae1603ba345147356336afb</a>.</p></li>\n<li><p><code class=\"docutils literal notranslate\">django.utils.safestring.SafeBytes</code> - Unused since Django 2.0.</p></li>\n</ul>\n</section>\n<section id=\"new-default-value-for-the-file-upload-permissions-setting\">\n<h3>New default value for the <code class=\"docutils literal notranslate\">FILE_UPLOAD_PERMISSIONS</code> setting<a class=\"heading-anchor\" href=\"#new-default-value-for-the-file-upload-permissions-setting\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h3>\n<p>In older versions, the <a class=\"reference internal\" href=\"/en/dev/ref/settings/#std-setting-FILE_UPLOAD_PERMISSIONS\"><code class=\"xref std std-setting docutils literal notranslate\">FILE_UPLOAD_PERMISSIONS</code></a> setting defaults to\n<code class=\"docutils literal notranslate\">None</code>. With the default <a class=\"reference internal\" href=\"/en/dev/ref/settings/#std-setting-FILE_UPLOAD_HANDLERS\"><code class=\"xref std std-setting docutils literal notranslate\">FILE_UPLOAD_HANDLERS</code></a>, this results in\nuploaded files having different permissions depending on their size and which\nupload handler is used.</p>\n<p><code class=\"docutils literal notranslate\">FILE_UPLOAD_PERMISSIONS</code> now defaults to <code class=\"docutils literal notranslate\">0o644</code> to avoid this\ninconsistency.</p>\n</section>\n<section id=\"new-default-values-for-security-settings\">\n<h3>New default values for security settings<a class=\"heading-anchor\" href=\"#new-default-values-for-security-settings\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h3>\n<p>To make Django projects more secure by default, some security settings now have\nmore secure default values:</p>\n<ul class=\"simple\">\n<li><p><a class=\"reference internal\" href=\"/en/dev/ref/settings/#std-setting-X_FRAME_OPTIONS\"><code class=\"xref std std-setting docutils literal notranslate\">X_FRAME_OPTIONS</code></a> now defaults to <code class=\"docutils literal notranslate\">'DENY'</code>.</p></li>\n<li><p><a class=\"reference internal\" href=\"/en/dev/ref/settings/#std-setting-SECURE_CONTENT_TYPE_NOSNIFF\"><code class=\"xref std std-setting docutils literal notranslate\">SECURE_CONTENT_TYPE_NOSNIFF</code></a> now defaults to <code class=\"docutils literal notranslate\">True</code>.</p></li>\n</ul>\n<p>See the <em>What’s New</em> <a class=\"reference internal\" href=\"#whats-new-security-3-0\"><span class=\"std std-ref\">Security section</span></a> above for\nmore details on these changes.</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><code class=\"docutils literal notranslate\">ContentType.__str__()</code> now includes the model’s <code class=\"docutils literal notranslate\">app_label</code> to\ndisambiguate models with the same name in different apps.</p></li>\n<li><p>Because accessing the language in the session rather than in the cookie is\ndeprecated, <code class=\"docutils literal notranslate\">LocaleMiddleware</code> no longer looks for the user’s language in\nthe session and <a class=\"reference internal\" href=\"/en/dev/topics/auth/default/#django.contrib.auth.logout\" title=\"django.contrib.auth.logout\"><code class=\"xref py py-func docutils literal notranslate\">django.contrib.auth.logout()</code></a> no longer preserves the\nsession’s language after logout.</p></li>\n<li><p><a class=\"reference internal\" href=\"/en/dev/ref/utils/#django.utils.html.escape\" title=\"django.utils.html.escape\"><code class=\"xref py py-func docutils literal notranslate\">django.utils.html.escape()</code></a> now uses <a class=\"reference external\" href=\"https://docs.python.org/3/library/html.html#html.escape\" title=\"(in Python v3.14)\"><code class=\"xref py py-func docutils literal notranslate\">html.escape()</code></a> to escape HTML.\nThis converts <code class=\"docutils literal notranslate\">'</code> to <code class=\"docutils literal notranslate\">&amp;#x27;</code> instead of the previous equivalent decimal\ncode <code class=\"docutils literal notranslate\">&amp;#39;</code>.</p></li>\n<li><p>The <code class=\"docutils literal notranslate\">django-admin test -k</code> option now works as the <a class=\"reference external\" href=\"https://docs.python.org/3/library/unittest.html#cmdoption-unittest-k\" title=\"(in Python v3.14)\"><code class=\"xref std std-option docutils literal notranslate\">unittest\n-k</code></a> option rather than as a shortcut for <code class=\"docutils literal notranslate\">--keepdb</code>.</p></li>\n<li><p>Support for <code class=\"docutils literal notranslate\">pywatchman</code> &lt; 1.2.0 is removed.</p></li>\n<li><p><a class=\"reference internal\" href=\"/en/dev/ref/utils/#django.utils.http.urlencode\" title=\"django.utils.http.urlencode\"><code class=\"xref py py-func docutils literal notranslate\">urlencode()</code></a> now encodes iterable values as they are\nwhen <code class=\"docutils literal notranslate\">doseq=False</code>, rather than iterating them, bringing it into line with\nthe standard library <a class=\"reference external\" href=\"https://docs.python.org/3/library/urllib.parse.html#urllib.parse.urlencode\" title=\"(in Python v3.14)\"><code class=\"xref py py-func docutils literal notranslate\">urllib.parse.urlencode()</code></a> function.</p></li>\n<li><p><code class=\"docutils literal notranslate\">intword</code> template filter now translates <code class=\"docutils literal notranslate\">1.0</code> as a singular phrase and\nall other numeric values as plural. This may be incorrect for some languages.</p></li>\n<li><p>Assigning a value to a model’s <a class=\"reference internal\" href=\"/en/dev/ref/models/fields/#django.db.models.ForeignKey\" title=\"django.db.models.ForeignKey\"><code class=\"xref py py-class docutils literal notranslate\">ForeignKey</code></a> or\n<a class=\"reference internal\" href=\"/en/dev/ref/models/fields/#django.db.models.OneToOneField\" title=\"django.db.models.OneToOneField\"><code class=\"xref py py-class docutils literal notranslate\">OneToOneField</code></a> <code class=\"docutils literal notranslate\">'_id'</code> attribute now unsets the\ncorresponding field. Accessing the field afterward will result in a query.</p></li>\n<li><p><a class=\"reference internal\" href=\"/en/dev/ref/utils/#django.utils.cache.patch_vary_headers\" title=\"django.utils.cache.patch_vary_headers\"><code class=\"xref py py-func docutils literal notranslate\">patch_vary_headers()</code></a> now handles an asterisk\n<code class=\"docutils literal notranslate\">'*'</code> according to <span class=\"target\" id=\"index-0\"></span><a class=\"rfc reference external\" href=\"https://datatracker.ietf.org/doc/html/rfc7231.html#section-7.1.4\"><strong>RFC 7231 Section 7.1.4</strong></a>, i.e. if a list of header\nfield names contains an asterisk, then the <code class=\"docutils literal notranslate\">Vary</code> header will consist of a\nsingle asterisk <code class=\"docutils literal notranslate\">'*'</code>.</p></li>\n<li><p>On MySQL 8.0.16+, <code class=\"docutils literal notranslate\">PositiveIntegerField</code> and <code class=\"docutils literal notranslate\">PositiveSmallIntegerField</code>\nnow include a check constraint to prevent negative values in the database.</p></li>\n<li><p><code class=\"docutils literal notranslate\">alias=None</code> is added to the signature of\n<a class=\"reference internal\" href=\"/en/dev/ref/models/expressions/#django.db.models.Expression.get_group_by_cols\" title=\"django.db.models.Expression.get_group_by_cols\"><code class=\"xref py py-meth docutils literal notranslate\">Expression.get_group_by_cols()</code></a>.</p></li>\n<li><p><code class=\"docutils literal notranslate\">RegexPattern</code>, used by <a class=\"reference internal\" href=\"/en/dev/ref/urls/#django.urls.re_path\" title=\"django.urls.re_path\"><code class=\"xref py py-func docutils literal notranslate\">re_path()</code></a>, no longer returns\nkeyword arguments with <code class=\"docutils literal notranslate\">None</code> values to be passed to the view for the\noptional named groups that are missing.</p></li>\n</ul>\n</section>\n</section>\n<section id=\"features-deprecated-in-3-0\">\n<span id=\"deprecated-features-3-0\"></span><h2>Features deprecated in 3.0<a class=\"heading-anchor\" href=\"#features-deprecated-in-3-0\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h2>\n<section id=\"django-utils-encoding-force-text-and-smart-text\">\n<h3><code class=\"docutils literal notranslate\">django.utils.encoding.force_text()</code> and <code class=\"docutils literal notranslate\">smart_text()</code><a class=\"heading-anchor\" href=\"#django-utils-encoding-force-text-and-smart-text\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h3>\n<p>The <code class=\"docutils literal notranslate\">smart_text()</code> and <code class=\"docutils literal notranslate\">force_text()</code> aliases (since Django 2.0) of\n<code class=\"docutils literal notranslate\">smart_str()</code> and <code class=\"docutils literal notranslate\">force_str()</code> are deprecated. Ignore this deprecation if\nyour code supports Python 2 as the behavior of <code class=\"docutils literal notranslate\">smart_str()</code> and\n<code class=\"docutils literal notranslate\">force_str()</code> is different there.</p>\n</section>\n<section id=\"id3\">\n<h3>Miscellaneous<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><code class=\"docutils literal notranslate\">django.utils.http.urlquote()</code>, <code class=\"docutils literal notranslate\">urlquote_plus()</code>, <code class=\"docutils literal notranslate\">urlunquote()</code>, and\n<code class=\"docutils literal notranslate\">urlunquote_plus()</code> are deprecated in favor of the functions that they’re\naliases for: <a class=\"reference external\" href=\"https://docs.python.org/3/library/urllib.parse.html#urllib.parse.quote\" title=\"(in Python v3.14)\"><code class=\"xref py py-func docutils literal notranslate\">urllib.parse.quote()</code></a>, <a class=\"reference external\" href=\"https://docs.python.org/3/library/urllib.parse.html#urllib.parse.quote_plus\" title=\"(in Python v3.14)\"><code class=\"xref py py-func docutils literal notranslate\">quote_plus()</code></a>,\n<a class=\"reference external\" href=\"https://docs.python.org/3/library/urllib.parse.html#urllib.parse.unquote\" title=\"(in Python v3.14)\"><code class=\"xref py py-func docutils literal notranslate\">unquote()</code></a>, and <a class=\"reference external\" href=\"https://docs.python.org/3/library/urllib.parse.html#urllib.parse.unquote_plus\" title=\"(in Python v3.14)\"><code class=\"xref py py-func docutils literal notranslate\">unquote_plus()</code></a>.</p></li>\n<li><p><code class=\"docutils literal notranslate\">django.utils.translation.ugettext()</code>, <code class=\"docutils literal notranslate\">ugettext_lazy()</code>,\n<code class=\"docutils literal notranslate\">ugettext_noop()</code>, <code class=\"docutils literal notranslate\">ungettext()</code>, and <code class=\"docutils literal notranslate\">ungettext_lazy()</code> are deprecated\nin favor of the functions that they’re aliases for:\n<a class=\"reference internal\" href=\"/en/dev/ref/utils/#django.utils.translation.gettext\" title=\"django.utils.translation.gettext\"><code class=\"xref py py-func docutils literal notranslate\">django.utils.translation.gettext()</code></a>,\n<a class=\"reference internal\" href=\"/en/dev/ref/utils/#django.utils.translation.gettext_lazy\" title=\"django.utils.translation.gettext_lazy\"><code class=\"xref py py-func docutils literal notranslate\">gettext_lazy()</code></a>,\n<a class=\"reference internal\" href=\"/en/dev/ref/utils/#django.utils.translation.gettext_noop\" title=\"django.utils.translation.gettext_noop\"><code class=\"xref py py-func docutils literal notranslate\">gettext_noop()</code></a>,\n<a class=\"reference internal\" href=\"/en/dev/ref/utils/#django.utils.translation.ngettext\" title=\"django.utils.translation.ngettext\"><code class=\"xref py py-func docutils literal notranslate\">ngettext()</code></a>, and\n<a class=\"reference internal\" href=\"/en/dev/ref/utils/#django.utils.translation.ngettext_lazy\" title=\"django.utils.translation.ngettext_lazy\"><code class=\"xref py py-func docutils literal notranslate\">ngettext_lazy()</code></a>.</p></li>\n<li><p>To limit creation of sessions and hence favor some caching strategies,\n<a class=\"reference internal\" href=\"/en/dev/topics/i18n/translation/#django.views.i18n.set_language\" title=\"django.views.i18n.set_language\"><code class=\"xref py py-func docutils literal notranslate\">django.views.i18n.set_language()</code></a> will stop setting the user’s language\nin the session in Django 4.0. Since Django 2.1, the language is always stored\nin the <a class=\"reference internal\" href=\"/en/dev/ref/settings/#std-setting-LANGUAGE_COOKIE_NAME\"><code class=\"xref std std-setting docutils literal notranslate\">LANGUAGE_COOKIE_NAME</code></a> cookie.</p></li>\n<li><p><code class=\"docutils literal notranslate\">django.utils.text.unescape_entities()</code> is deprecated in favor of\n<a class=\"reference external\" href=\"https://docs.python.org/3/library/html.html#html.unescape\" title=\"(in Python v3.14)\"><code class=\"xref py py-func docutils literal notranslate\">html.unescape()</code></a>. Note that unlike <code class=\"docutils literal notranslate\">unescape_entities()</code>,\n<code class=\"docutils literal notranslate\">html.unescape()</code> evaluates lazy strings immediately.</p></li>\n<li><p>To avoid possible confusion as to effective scope, the private internal\nutility <code class=\"docutils literal notranslate\">is_safe_url()</code> is renamed to\n<code class=\"docutils literal notranslate\">url_has_allowed_host_and_scheme()</code>. That a URL has an allowed host and\nscheme doesn’t in general imply that it’s “safe”. It may still be quoted\nincorrectly, for example. Ensure to also use\n<a class=\"reference internal\" href=\"/en/dev/ref/utils/#django.utils.encoding.iri_to_uri\" title=\"django.utils.encoding.iri_to_uri\"><code class=\"xref py py-func docutils literal notranslate\">iri_to_uri()</code></a> on the path component of untrusted\nURLs.</p></li>\n</ul>\n</section>\n</section>\n<section id=\"features-removed-in-3-0\">\n<span id=\"removed-features-3-0\"></span><h2>Features removed in 3.0<a class=\"heading-anchor\" href=\"#features-removed-in-3-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 3.0.</p>\n<p>See <a class=\"reference internal\" href=\"/en/dev/releases/2.0/#deprecated-features-2-0\"><span class=\"std std-ref\">Features deprecated in 2.0</span></a> for details on these changes, including how\nto remove usage of these features.</p>\n<ul class=\"simple\">\n<li><p>The <code class=\"docutils literal notranslate\">django.db.backends.postgresql_psycopg2</code> module is removed.</p></li>\n<li><p><code class=\"docutils literal notranslate\">django.shortcuts.render_to_response()</code> is removed.</p></li>\n<li><p>The <code class=\"docutils literal notranslate\">DEFAULT_CONTENT_TYPE</code> setting is removed.</p></li>\n<li><p><code class=\"docutils literal notranslate\">HttpRequest.xreadlines()</code> is removed.</p></li>\n<li><p>Support for the <code class=\"docutils literal notranslate\">context</code> argument of <code class=\"docutils literal notranslate\">Field.from_db_value()</code> and\n<code class=\"docutils literal notranslate\">Expression.convert_value()</code> is removed.</p></li>\n<li><p>The <code class=\"docutils literal notranslate\">field_name</code> keyword argument of <code class=\"docutils literal notranslate\">QuerySet.earliest()</code> and\n<code class=\"docutils literal notranslate\">latest()</code> is removed.</p></li>\n</ul>\n<p>See <a class=\"reference internal\" href=\"/en/dev/releases/2.1/#deprecated-features-2-1\"><span class=\"std std-ref\">Features deprecated in 2.1</span></a> for details on these changes, including how\nto remove usage of these features.</p>\n<ul class=\"simple\">\n<li><p>The <code class=\"docutils literal notranslate\">ForceRHR</code> GIS function is removed.</p></li>\n<li><p><code class=\"docutils literal notranslate\">django.utils.http.cookie_date()</code> is removed.</p></li>\n<li><p>The <code class=\"docutils literal notranslate\">staticfiles</code> and <code class=\"docutils literal notranslate\">admin_static</code> template tag libraries are removed.</p></li>\n<li><p><code class=\"docutils literal notranslate\">django.contrib.staticfiles.templatetags.staticfiles.static()</code> is removed.</p></li>\n</ul>\n</section>","rootId":"django-3-0-release-notes","toc":[{"title":"Python compatibility","anchor":"python-compatibility","children":[]},{"title":"Third-party library support for older version of Django","anchor":"third-party-library-support-for-older-version-of-django","children":[]},{"title":"What’s new in Django 3.0","anchor":"what-s-new-in-django-3-0","children":[{"title":"MariaDB support","anchor":"mariadb-support","children":[]},{"title":"ASGI support","anchor":"asgi-support","children":[]},{"title":"Exclusion constraints on PostgreSQL","anchor":"exclusion-constraints-on-postgresql","children":[]},{"title":"Filter expressions","anchor":"filter-expressions","children":[]},{"title":"Enumerations for model field choices","anchor":"enumerations-for-model-field-choices","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.sessions","anchor":"django-contrib-sessions","children":[]},{"title":"django.contrib.syndication","anchor":"django-contrib-syndication","children":[]},{"title":"Cache","anchor":"cache","children":[]},{"title":"File Storage","anchor":"file-storage","children":[]},{"title":"Forms","anchor":"forms","children":[]},{"title":"Internationalization","anchor":"internationalization","children":[]},{"title":"Logging","anchor":"logging","children":[]},{"title":"Management Commands","anchor":"management-commands","children":[]},{"title":"Models","anchor":"models","children":[]},{"title":"Requests and Responses","anchor":"requests-and-responses","children":[]},{"title":"Security","anchor":"security","children":[]},{"title":"Tests","anchor":"tests","children":[]}]}]},{"title":"Backwards incompatible changes in 3.0","anchor":"backwards-incompatible-changes-in-3-0","children":[{"title":"Model.save() when providing a default for the primary key","anchor":"model-save-when-providing-a-default-for-the-primary-key","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":"Dropped support for PostgreSQL 9.4","anchor":"dropped-support-for-postgresql-9-4","children":[]},{"title":"Dropped support for Oracle 12.1","anchor":"dropped-support-for-oracle-12-1","children":[]},{"title":"Removed private Python 2 compatibility APIs","anchor":"removed-private-python-2-compatibility-apis","children":[]},{"title":"New default value for the FILE_UPLOAD_PERMISSIONS setting","anchor":"new-default-value-for-the-file-upload-permissions-setting","children":[]},{"title":"New default values for security settings","anchor":"new-default-values-for-security-settings","children":[]},{"title":"Miscellaneous","anchor":"miscellaneous","children":[]}]},{"title":"Features deprecated in 3.0","anchor":"features-deprecated-in-3-0","children":[{"title":"django.utils.encoding.force_text() and smart_text()","anchor":"django-utils-encoding-force-text-and-smart-text","children":[]},{"title":"Miscellaneous","anchor":"id3","children":[]}]},{"title":"Features removed in 3.0","anchor":"features-removed-in-3-0","children":[]}],"breadcrumbs":[{"docname":"releases/index","title":"Release notes","url":"/en/dev/releases/"}],"prev":{"docname":"releases/3.0.1","title":"Django 3.0.1 release notes","url":"/en/dev/releases/3.0.1/"},"next":{"docname":"releases/2.2.28","title":"Django 2.2.28 release notes","url":"/en/dev/releases/2.2.28/"},"formats":{"html":"/en/dev/releases/3.0/","markdown":"/en/dev/releases/3.0.md","json":"/en/dev/releases/3.0.json"},"source":"https://github.com/django/django/blob/main/docs/releases/3.0.txt","official":"https://docs.djangoproject.com/en/dev/releases/3.0/","inVersions":["dev","6.1","6.0","5.2","5.1","5.0","4.2","4.1","4.0","3.2","3.1","3.0"],"inLocales":["en"]}