{"title":"Settings","version":"4.1","locale":"it","docname":"ref/settings","url":"/it/4.1/ref/settings/","canonical":"https://djangodocs.dev/it/4.1/ref/settings/","summary":"Here’s a list of settings available in Django core and their default values. Settings provided by contrib apps are listed below, followed by a topical index…","html":"<h1>Settings<a class=\"heading-anchor\" href=\"#settings\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h1>\n<nav class=\"contents local\" id=\"indice\">\n<ul class=\"simple\">\n<li><p><a class=\"reference internal\" href=\"#core-settings\" id=\"id12\">Core Settings</a></p></li>\n<li><p><a class=\"reference internal\" href=\"#auth\" id=\"id13\">Auth</a></p></li>\n<li><p><a class=\"reference internal\" href=\"#messages\" id=\"id14\">Messages</a></p></li>\n<li><p><a class=\"reference internal\" href=\"#sessions\" id=\"id15\">Sessions</a></p></li>\n<li><p><a class=\"reference internal\" href=\"#sites\" id=\"id16\">Sites</a></p></li>\n<li><p><a class=\"reference internal\" href=\"#static-files\" id=\"id17\">Static Files</a></p></li>\n<li><p><a class=\"reference internal\" href=\"#core-settings-topical-index\" id=\"id18\">Core Settings Topical Index</a></p></li>\n</ul>\n</nav>\n<aside class=\"admonition admonition-warning\" role=\"note\">\n<p class=\"admonition-title\">Avvertimento</p>\n<p>Be careful when you override settings, especially when the default value\nis a non-empty list or dictionary, such as <a class=\"reference internal\" href=\"#std-setting-STATICFILES_FINDERS\"><code class=\"xref std std-setting docutils literal notranslate\">STATICFILES_FINDERS</code></a>.\nMake sure you keep the components required by the features of Django you\nwish to use.</p>\n</aside>\n<section id=\"core-settings\">\n<h2><a class=\"toc-backref\" href=\"#id12\" role=\"doc-backlink\">Core Settings</a><a class=\"headerlink\" href=\"#core-settings\" title=\"Link to this heading\">¶</a></h2>\n<p>Here’s a list of settings available in Django core and their default values.\nSettings provided by contrib apps are listed below, followed by a topical index\nof the core settings. For introductory material, see the <a class=\"reference internal\" href=\"/it/4.1/topics/settings/\"><span class=\"doc\">settings topic\nguide</span></a>.</p>\n<section id=\"absolute-url-overrides\">\n<span id=\"std-setting-ABSOLUTE_URL_OVERRIDES\"></span><h3><code class=\"docutils literal notranslate\">ABSOLUTE_URL_OVERRIDES</code><a class=\"heading-anchor\" href=\"#absolute-url-overrides\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h3>\n<p>Default: <code class=\"docutils literal notranslate\">{}</code> (Empty dictionary)</p>\n<p>A dictionary mapping <code class=\"docutils literal notranslate\">&quot;app_label.model_name&quot;</code> strings to functions that take\na model object and return its URL. This is a way of inserting or overriding\n<code class=\"docutils literal notranslate\">get_absolute_url()</code> methods on a per-installation basis. Example:</p>\n<div class=\"code-block\" data-language=\"default\"><div class=\"code-block-toolbar\"><span class=\"code-block-language\">Code</span><button type=\"button\" class=\"copy-button\" data-copy hidden><span class=\"copy-button-label\">Copy</span></button></div><pre role=\"group\" tabindex=\"0\" aria-label=\"Code code\"><code>ABSOLUTE_URL_OVERRIDES <span class=\"o\">=</span> <span class=\"p\">{</span>\n    <span class=\"s1\">&#39;blogs.blog&#39;</span><span class=\"p\">:</span> <span class=\"k\">lambda</span> o<span class=\"p\">:</span> <span class=\"s2\">&quot;/blogs/</span><span class=\"si\">%s</span><span class=\"s2\">/&quot;</span> <span class=\"o\">%</span> o<span class=\"o\">.</span>slug<span class=\"p\">,</span>\n    <span class=\"s1\">&#39;news.story&#39;</span><span class=\"p\">:</span> <span class=\"k\">lambda</span> o<span class=\"p\">:</span> <span class=\"s2\">&quot;/stories/</span><span class=\"si\">%s</span><span class=\"s2\">/</span><span class=\"si\">%s</span><span class=\"s2\">/&quot;</span> <span class=\"o\">%</span> <span class=\"p\">(</span>o<span class=\"o\">.</span>pub_year<span class=\"p\">,</span> o<span class=\"o\">.</span>slug<span class=\"p\">),</span>\n<span class=\"p\">}</span>\n</code></pre></div>\n<p>The model name used in this setting should be all lowercase, regardless of the\ncase of the actual model class name.</p>\n</section>\n<section id=\"admins\">\n<span id=\"std-setting-ADMINS\"></span><h3><code class=\"docutils literal notranslate\">ADMINS</code><a class=\"heading-anchor\" href=\"#admins\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h3>\n<p>Default: <code class=\"docutils literal notranslate\">[]</code> (Empty list)</p>\n<p>A list of all the people who get code error notifications. When\n<a class=\"reference internal\" href=\"#std-setting-DEBUG\"><code class=\"xref std std-setting docutils literal notranslate\">DEBUG=False</code></a> and <a class=\"reference internal\" href=\"/it/4.1/ref/logging/#django.utils.log.AdminEmailHandler\" title=\"django.utils.log.AdminEmailHandler\"><code class=\"xref py py-class docutils literal notranslate\">AdminEmailHandler</code></a>\nis configured in <a class=\"reference internal\" href=\"#std-setting-LOGGING\"><code class=\"xref std std-setting docutils literal notranslate\">LOGGING</code></a> (done by default), Django emails these\npeople the details of exceptions raised in the request/response cycle.</p>\n<p>Each item in the list should be a tuple of (Full name, email address). Example:</p>\n<div class=\"code-block\" data-language=\"default\"><div class=\"code-block-toolbar\"><span class=\"code-block-language\">Code</span><button type=\"button\" class=\"copy-button\" data-copy hidden><span class=\"copy-button-label\">Copy</span></button></div><pre role=\"group\" tabindex=\"0\" aria-label=\"Code code\"><code><span class=\"p\">[(</span><span class=\"s1\">&#39;John&#39;</span><span class=\"p\">,</span> <span class=\"s1\">&#39;john@example.com&#39;</span><span class=\"p\">),</span> <span class=\"p\">(</span><span class=\"s1\">&#39;Mary&#39;</span><span class=\"p\">,</span> <span class=\"s1\">&#39;mary@example.com&#39;</span><span class=\"p\">)]</span>\n</code></pre></div>\n</section>\n<section id=\"allowed-hosts\">\n<span id=\"std-setting-ALLOWED_HOSTS\"></span><h3><code class=\"docutils literal notranslate\">ALLOWED_HOSTS</code><a class=\"heading-anchor\" href=\"#allowed-hosts\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h3>\n<p>Default: <code class=\"docutils literal notranslate\">[]</code> (Empty list)</p>\n<p>A list of strings representing the host/domain names that this Django site can\nserve. This is a security measure to prevent <a class=\"reference internal\" href=\"/it/4.1/topics/security/#host-headers-virtual-hosting\"><span class=\"std std-ref\">HTTP Host header attacks</span></a>, which are possible even under many\nseemingly-safe web server configurations.</p>\n<p>Values in this list can be fully qualified names (e.g. <code class=\"docutils literal notranslate\">'www.example.com'</code>),\nin which case they will be matched against the request’s <code class=\"docutils literal notranslate\">Host</code> header\nexactly (case-insensitive, not including port). A value beginning with a period\ncan be used as a subdomain wildcard: <code class=\"docutils literal notranslate\">'.example.com'</code> will match\n<code class=\"docutils literal notranslate\">example.com</code>, <code class=\"docutils literal notranslate\">www.example.com</code>, and any other subdomain of\n<code class=\"docutils literal notranslate\">example.com</code>. A value of <code class=\"docutils literal notranslate\">'*'</code> will match anything; in this case you are\nresponsible to provide your own validation of the <code class=\"docutils literal notranslate\">Host</code> header (perhaps in a\nmiddleware; if so this middleware must be listed first in\n<a class=\"reference internal\" href=\"#std-setting-MIDDLEWARE\"><code class=\"xref std std-setting docutils literal notranslate\">MIDDLEWARE</code></a>).</p>\n<p>Django also allows the <a class=\"reference external\" href=\"https://en.wikipedia.org/wiki/Fully_qualified_domain_name\">fully qualified domain name (FQDN)</a> of any entries.\nSome browsers include a trailing dot in the <code class=\"docutils literal notranslate\">Host</code> header which Django\nstrips when performing host validation.</p>\n<p>If the <code class=\"docutils literal notranslate\">Host</code> header (or <code class=\"docutils literal notranslate\">X-Forwarded-Host</code> if\n<a class=\"reference internal\" href=\"#std-setting-USE_X_FORWARDED_HOST\"><code class=\"xref std std-setting docutils literal notranslate\">USE_X_FORWARDED_HOST</code></a> is enabled) does not match any value in this\nlist, the <a class=\"reference internal\" href=\"/it/4.1/ref/request-response/#django.http.HttpRequest.get_host\" title=\"django.http.HttpRequest.get_host\"><code class=\"xref py py-meth docutils literal notranslate\">django.http.HttpRequest.get_host()</code></a> method will raise\n<a class=\"reference internal\" href=\"/it/4.1/ref/exceptions/#django.core.exceptions.SuspiciousOperation\" title=\"django.core.exceptions.SuspiciousOperation\"><code class=\"xref py py-exc docutils literal notranslate\">SuspiciousOperation</code></a>.</p>\n<p>When <a class=\"reference internal\" href=\"#std-setting-DEBUG\"><code class=\"xref std std-setting docutils literal notranslate\">DEBUG</code></a> is <code class=\"docutils literal notranslate\">True</code> and <code class=\"docutils literal notranslate\">ALLOWED_HOSTS</code> is empty, the host\nis validated against <code class=\"docutils literal notranslate\">['.localhost', '127.0.0.1', '[::1]']</code>.</p>\n<p><code class=\"docutils literal notranslate\">ALLOWED_HOSTS</code> is also <a class=\"reference internal\" href=\"/it/4.1/topics/testing/advanced/#topics-testing-advanced-multiple-hosts\"><span class=\"std std-ref\">checked when running tests</span></a>.</p>\n<p>This validation only applies via <a class=\"reference internal\" href=\"/it/4.1/ref/request-response/#django.http.HttpRequest.get_host\" title=\"django.http.HttpRequest.get_host\"><code class=\"xref py py-meth docutils literal notranslate\">get_host()</code></a>;\nif your code accesses the <code class=\"docutils literal notranslate\">Host</code> header directly from <code class=\"docutils literal notranslate\">request.META</code> you\nare bypassing this security protection.</p>\n</section>\n<section id=\"append-slash\">\n<span id=\"std-setting-APPEND_SLASH\"></span><h3><code class=\"docutils literal notranslate\">APPEND_SLASH</code><a class=\"heading-anchor\" href=\"#append-slash\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h3>\n<p>Default: <code class=\"docutils literal notranslate\">True</code></p>\n<p>When set to <code class=\"docutils literal notranslate\">True</code>, if the request URL does not match any of the patterns\nin the URLconf and it doesn’t end in a slash, an HTTP redirect is issued to the\nsame URL with a slash appended. Note that the redirect may cause any data\nsubmitted in a POST request to be lost.</p>\n<p>The <a class=\"reference internal\" href=\"#std-setting-APPEND_SLASH\"><code class=\"xref std std-setting docutils literal notranslate\">APPEND_SLASH</code></a> setting is only used if\n<a class=\"reference internal\" href=\"/it/4.1/ref/middleware/#django.middleware.common.CommonMiddleware\" title=\"django.middleware.common.CommonMiddleware\"><code class=\"xref py py-class docutils literal notranslate\">CommonMiddleware</code></a> is installed\n(see <a class=\"reference internal\" href=\"/it/4.1/topics/http/middleware/\"><span class=\"doc\">Middleware</span></a>). See also <a class=\"reference internal\" href=\"#std-setting-PREPEND_WWW\"><code class=\"xref std std-setting docutils literal notranslate\">PREPEND_WWW</code></a>.</p>\n</section>\n<section id=\"caches\">\n<span id=\"std-setting-CACHES\"></span><h3><code class=\"docutils literal notranslate\">CACHES</code><a class=\"heading-anchor\" href=\"#caches\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h3>\n<p>Default:</p>\n<div class=\"code-block\" data-language=\"default\"><div class=\"code-block-toolbar\"><span class=\"code-block-language\">Code</span><button type=\"button\" class=\"copy-button\" data-copy hidden><span class=\"copy-button-label\">Copy</span></button></div><pre role=\"group\" tabindex=\"0\" aria-label=\"Code code\"><code><span class=\"p\">{</span>\n    <span class=\"s1\">&#39;default&#39;</span><span class=\"p\">:</span> <span class=\"p\">{</span>\n        <span class=\"s1\">&#39;BACKEND&#39;</span><span class=\"p\">:</span> <span class=\"s1\">&#39;django.core.cache.backends.locmem.LocMemCache&#39;</span><span class=\"p\">,</span>\n    <span class=\"p\">}</span>\n<span class=\"p\">}</span>\n</code></pre></div>\n<p>A dictionary containing the settings for all caches to be used with\nDjango. It is a nested dictionary whose contents maps cache aliases\nto a dictionary containing the options for an individual cache.</p>\n<p>The <a class=\"reference internal\" href=\"#std-setting-CACHES\"><code class=\"xref std std-setting docutils literal notranslate\">CACHES</code></a> setting must configure a <code class=\"docutils literal notranslate\">default</code> cache;\nany number of additional caches may also be specified. If you\nare using a cache backend other than the local memory cache, or\nyou need to define multiple caches, other options will be required.\nThe following cache options are available.</p>\n<section id=\"backend\">\n<span id=\"std-setting-CACHES-BACKEND\"></span><h4><code class=\"docutils literal notranslate\">BACKEND</code><a class=\"heading-anchor\" href=\"#backend\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h4>\n<p>Default: <code class=\"docutils literal notranslate\">''</code> (Empty string)</p>\n<p>The cache backend to use. The built-in cache backends are:</p>\n<ul class=\"simple\">\n<li><p><code class=\"docutils literal notranslate\">'django.core.cache.backends.db.DatabaseCache'</code></p></li>\n<li><p><code class=\"docutils literal notranslate\">'django.core.cache.backends.dummy.DummyCache'</code></p></li>\n<li><p><code class=\"docutils literal notranslate\">'django.core.cache.backends.filebased.FileBasedCache'</code></p></li>\n<li><p><code class=\"docutils literal notranslate\">'django.core.cache.backends.locmem.LocMemCache'</code></p></li>\n<li><p><code class=\"docutils literal notranslate\">'django.core.cache.backends.memcached.PyMemcacheCache'</code></p></li>\n<li><p><code class=\"docutils literal notranslate\">'django.core.cache.backends.memcached.PyLibMCCache'</code></p></li>\n<li><p><code class=\"docutils literal notranslate\">'django.core.cache.backends.redis.RedisCache'</code></p></li>\n</ul>\n<p>You can use a cache backend that doesn’t ship with Django by setting\n<a class=\"reference internal\" href=\"#std-setting-CACHES-BACKEND\"><code class=\"xref std std-setting docutils literal notranslate\">BACKEND</code></a> to a fully-qualified path of a cache\nbackend class (i.e. <code class=\"docutils literal notranslate\">mypackage.backends.whatever.WhateverCache</code>).</p>\n<aside class=\"version-note version-changed\" data-version=\"4.0\" role=\"note\">\n<p class=\"version-note-title\">Changed in Django 4.0</p><p>The <code class=\"docutils literal notranslate\">RedisCache</code> backend was added.</p>\n</aside>\n</section>\n<section id=\"key-function\">\n<span id=\"std-setting-CACHES-KEY_FUNCTION\"></span><h4><code class=\"docutils literal notranslate\">KEY_FUNCTION</code><a class=\"heading-anchor\" href=\"#key-function\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h4>\n<p>A string containing a dotted path to a function (or any callable) that defines how to\ncompose a prefix, version and key into a final cache key. The default\nimplementation is equivalent to the function:</p>\n<div class=\"code-block\" data-language=\"default\"><div class=\"code-block-toolbar\"><span class=\"code-block-language\">Code</span><button type=\"button\" class=\"copy-button\" data-copy hidden><span class=\"copy-button-label\">Copy</span></button></div><pre role=\"group\" tabindex=\"0\" aria-label=\"Code code\"><code><span class=\"k\">def</span> <span class=\"nf\">make_key</span><span class=\"p\">(</span>key<span class=\"p\">,</span> key_prefix<span class=\"p\">,</span> version<span class=\"p\">):</span>\n    <span class=\"k\">return</span> <span class=\"s1\">&#39;:&#39;</span><span class=\"o\">.</span>join<span class=\"p\">([</span>key_prefix<span class=\"p\">,</span> <span class=\"nb\">str</span><span class=\"p\">(</span>version<span class=\"p\">),</span> key<span class=\"p\">])</span>\n</code></pre></div>\n<p>You may use any key function you want, as long as it has the same\nargument signature.</p>\n<p>See the <a class=\"reference internal\" href=\"/it/4.1/topics/cache/#cache-key-transformation\"><span class=\"std std-ref\">cache documentation</span></a> for more\ninformation.</p>\n</section>\n<section id=\"key-prefix\">\n<span id=\"std-setting-CACHES-KEY_PREFIX\"></span><h4><code class=\"docutils literal notranslate\">KEY_PREFIX</code><a class=\"heading-anchor\" href=\"#key-prefix\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h4>\n<p>Default: <code class=\"docutils literal notranslate\">''</code> (Empty string)</p>\n<p>A string that will be automatically included (prepended by default) to\nall cache keys used by the Django server.</p>\n<p>See the <a class=\"reference internal\" href=\"/it/4.1/topics/cache/#cache-key-prefixing\"><span class=\"std std-ref\">cache documentation</span></a> for more information.</p>\n</section>\n<section id=\"location\">\n<span id=\"std-setting-CACHES-LOCATION\"></span><h4><code class=\"docutils literal notranslate\">LOCATION</code><a class=\"heading-anchor\" href=\"#location\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h4>\n<p>Default: <code class=\"docutils literal notranslate\">''</code> (Empty string)</p>\n<p>The location of the cache to use. This might be the directory for a\nfile system cache, a host and port for a memcache server, or an identifying\nname for a local memory cache. e.g.:</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>CACHES <span class=\"o\">=</span> <span class=\"p\">{</span>\n    <span class=\"s1\">&#39;default&#39;</span><span class=\"p\">:</span> <span class=\"p\">{</span>\n        <span class=\"s1\">&#39;BACKEND&#39;</span><span class=\"p\">:</span> <span class=\"s1\">&#39;django.core.cache.backends.filebased.FileBasedCache&#39;</span><span class=\"p\">,</span>\n        <span class=\"s1\">&#39;LOCATION&#39;</span><span class=\"p\">:</span> <span class=\"s1\">&#39;/var/tmp/django_cache&#39;</span><span class=\"p\">,</span>\n    <span class=\"p\">}</span>\n<span class=\"p\">}</span>\n</code></pre></div>\n</section>\n<section id=\"options\">\n<span id=\"std-setting-CACHES-OPTIONS\"></span><h4><code class=\"docutils literal notranslate\">OPTIONS</code><a class=\"heading-anchor\" href=\"#options\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h4>\n<p>Default: <code class=\"docutils literal notranslate\">None</code></p>\n<p>Extra parameters to pass to the cache backend. Available parameters\nvary depending on your cache backend.</p>\n<p>Some information on available parameters can be found in the\n<a class=\"reference internal\" href=\"/it/4.1/topics/cache/#cache-arguments\"><span class=\"std std-ref\">cache arguments</span></a> documentation. For more information,\nconsult your backend module’s own documentation.</p>\n</section>\n<section id=\"timeout\">\n<span id=\"std-setting-CACHES-TIMEOUT\"></span><h4><code class=\"docutils literal notranslate\">TIMEOUT</code><a class=\"heading-anchor\" href=\"#timeout\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h4>\n<p>Default: <code class=\"docutils literal notranslate\">300</code></p>\n<p>The number of seconds before a cache entry is considered stale. If the value of\nthis setting is <code class=\"docutils literal notranslate\">None</code>, cache entries will not expire. A value of <code class=\"docutils literal notranslate\">0</code>\ncauses keys to immediately expire (effectively «don’t cache»).</p>\n</section>\n<section id=\"version\">\n<span id=\"std-setting-CACHES-VERSION\"></span><h4><code class=\"docutils literal notranslate\">VERSION</code><a class=\"heading-anchor\" href=\"#version\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h4>\n<p>Default: <code class=\"docutils literal notranslate\">1</code></p>\n<p>The default version number for cache keys generated by the Django server.</p>\n<p>See the <a class=\"reference internal\" href=\"/it/4.1/topics/cache/#cache-versioning\"><span class=\"std std-ref\">cache documentation</span></a> for more information.</p>\n</section>\n</section>\n<section id=\"cache-middleware-alias\">\n<span id=\"std-setting-CACHE_MIDDLEWARE_ALIAS\"></span><h3><code class=\"docutils literal notranslate\">CACHE_MIDDLEWARE_ALIAS</code><a class=\"heading-anchor\" href=\"#cache-middleware-alias\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h3>\n<p>Default: <code class=\"docutils literal notranslate\">'default'</code></p>\n<p>The cache connection to use for the <a class=\"reference internal\" href=\"/it/4.1/topics/cache/#the-per-site-cache\"><span class=\"std std-ref\">cache middleware</span></a>.</p>\n</section>\n<section id=\"cache-middleware-key-prefix\">\n<span id=\"std-setting-CACHE_MIDDLEWARE_KEY_PREFIX\"></span><h3><code class=\"docutils literal notranslate\">CACHE_MIDDLEWARE_KEY_PREFIX</code><a class=\"heading-anchor\" href=\"#cache-middleware-key-prefix\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h3>\n<p>Default: <code class=\"docutils literal notranslate\">''</code> (Empty string)</p>\n<p>A string which will be prefixed to the cache keys generated by the <a class=\"reference internal\" href=\"/it/4.1/topics/cache/#the-per-site-cache\"><span class=\"std std-ref\">cache\nmiddleware</span></a>. This prefix is combined with the\n<a class=\"reference internal\" href=\"#std-setting-CACHES-KEY_PREFIX\"><code class=\"xref std std-setting docutils literal notranslate\">KEY_PREFIX</code></a> setting; it does not replace it.</p>\n<p>See <a class=\"reference internal\" href=\"/it/4.1/topics/cache/\"><span class=\"doc\">Django’s cache framework</span></a>.</p>\n</section>\n<section id=\"cache-middleware-seconds\">\n<span id=\"std-setting-CACHE_MIDDLEWARE_SECONDS\"></span><h3><code class=\"docutils literal notranslate\">CACHE_MIDDLEWARE_SECONDS</code><a class=\"heading-anchor\" href=\"#cache-middleware-seconds\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h3>\n<p>Default: <code class=\"docutils literal notranslate\">600</code></p>\n<p>The default number of seconds to cache a page for the <a class=\"reference internal\" href=\"/it/4.1/topics/cache/#the-per-site-cache\"><span class=\"std std-ref\">cache middleware</span></a>.</p>\n<p>See <a class=\"reference internal\" href=\"/it/4.1/topics/cache/\"><span class=\"doc\">Django’s cache framework</span></a>.</p>\n</section>\n<section id=\"csrf-cookie-age\">\n<span id=\"std-setting-CSRF_COOKIE_AGE\"></span><span id=\"settings-csrf\"></span><h3><code class=\"docutils literal notranslate\">CSRF_COOKIE_AGE</code><a class=\"heading-anchor\" href=\"#csrf-cookie-age\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h3>\n<p>Default: <code class=\"docutils literal notranslate\">31449600</code> (approximately 1 year, in seconds)</p>\n<p>The age of CSRF cookies, in seconds.</p>\n<p>The reason for setting a long-lived expiration time is to avoid problems in\nthe case of a user closing a browser or bookmarking a page and then loading\nthat page from a browser cache. Without persistent cookies, the form submission\nwould fail in this case.</p>\n<p>Some browsers (specifically Internet Explorer) can disallow the use of\npersistent cookies or can have the indexes to the cookie jar corrupted on disk,\nthereby causing CSRF protection checks to (sometimes intermittently) fail.\nChange this setting to <code class=\"docutils literal notranslate\">None</code> to use session-based CSRF cookies, which\nkeep the cookies in-memory instead of on persistent storage.</p>\n</section>\n<section id=\"csrf-cookie-domain\">\n<span id=\"std-setting-CSRF_COOKIE_DOMAIN\"></span><h3><code class=\"docutils literal notranslate\">CSRF_COOKIE_DOMAIN</code><a class=\"heading-anchor\" href=\"#csrf-cookie-domain\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h3>\n<p>Default: <code class=\"docutils literal notranslate\">None</code></p>\n<p>The domain to be used when setting the CSRF cookie.  This can be useful for\neasily allowing cross-subdomain requests to be excluded from the normal cross\nsite request forgery protection.  It should be set to a string such as\n<code class=\"docutils literal notranslate\">&quot;.example.com&quot;</code> to allow a POST request from a form on one subdomain to be\naccepted by a view served from another subdomain.</p>\n<p>Please note that the presence of this setting does not imply that Django’s CSRF\nprotection is safe from cross-subdomain attacks by default - please see the\n<a class=\"reference internal\" href=\"/it/4.1/ref/csrf/#csrf-limitations\"><span class=\"std std-ref\">CSRF limitations</span></a> section.</p>\n</section>\n<section id=\"csrf-cookie-httponly\">\n<span id=\"std-setting-CSRF_COOKIE_HTTPONLY\"></span><h3><code class=\"docutils literal notranslate\">CSRF_COOKIE_HTTPONLY</code><a class=\"heading-anchor\" href=\"#csrf-cookie-httponly\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h3>\n<p>Default: <code class=\"docutils literal notranslate\">False</code></p>\n<p>Whether to use <code class=\"docutils literal notranslate\">HttpOnly</code> flag on the CSRF cookie. If this is set to\n<code class=\"docutils literal notranslate\">True</code>, client-side JavaScript will not be able to access the CSRF cookie.</p>\n<p>Designating the CSRF cookie as <code class=\"docutils literal notranslate\">HttpOnly</code> doesn’t offer any practical\nprotection because CSRF is only to protect against cross-domain attacks. If an\nattacker can read the cookie via JavaScript, they’re already on the same domain\nas far as the browser knows, so they can do anything they like anyway. (XSS is\na much bigger hole than CSRF.)</p>\n<p>Although the setting offers little practical benefit, it’s sometimes required\nby security auditors.</p>\n<p>If you enable this and need to send the value of the CSRF token with an AJAX\nrequest, your JavaScript must pull the value <a class=\"reference internal\" href=\"/it/4.1/howto/csrf/#acquiring-csrf-token-from-html\"><span class=\"std std-ref\">from a hidden CSRF token\nform input</span></a> instead of <a class=\"reference internal\" href=\"/it/4.1/howto/csrf/#acquiring-csrf-token-from-cookie\"><span class=\"std std-ref\">from the cookie</span></a>.</p>\n<p>See <a class=\"reference internal\" href=\"#std-setting-SESSION_COOKIE_HTTPONLY\"><code class=\"xref std std-setting docutils literal notranslate\">SESSION_COOKIE_HTTPONLY</code></a> for details on <code class=\"docutils literal notranslate\">HttpOnly</code>.</p>\n</section>\n<section id=\"csrf-cookie-masked\">\n<span id=\"std-setting-CSRF_COOKIE_MASKED\"></span><h3><code class=\"docutils literal notranslate\">CSRF_COOKIE_MASKED</code><a class=\"heading-anchor\" href=\"#csrf-cookie-masked\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h3>\n<aside class=\"version-note version-added\" data-version=\"4.1\" role=\"note\">\n<p class=\"version-note-title\">New in Django 4.1</p></aside>\n<p>Default: <code class=\"docutils literal notranslate\">False</code></p>\n<p>Whether to mask the CSRF cookie. See\n<a class=\"reference internal\" href=\"/it/4.1/releases/4.1/#csrf-cookie-masked-usage\"><span class=\"std std-ref\">release notes</span></a> for usage details.</p>\n<aside class=\"version-note version-deprecated\" data-version=\"4.1\" role=\"note\">\n<p class=\"version-note-title\">Deprecated since Django 4.1</p><p><span class=\"versionmodified deprecated\">Deprecato dalla versione 4.1: </span>This transitional setting is deprecated and will be removed in Django 5.0.</p>\n</aside>\n</section>\n<section id=\"csrf-cookie-name\">\n<span id=\"std-setting-CSRF_COOKIE_NAME\"></span><h3><code class=\"docutils literal notranslate\">CSRF_COOKIE_NAME</code><a class=\"heading-anchor\" href=\"#csrf-cookie-name\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h3>\n<p>Default: <code class=\"docutils literal notranslate\">'csrftoken'</code></p>\n<p>The name of the cookie to use for the CSRF authentication token. This can be\nwhatever you want (as long as it’s different from the other cookie names in\nyour application). See <a class=\"reference internal\" href=\"/it/4.1/ref/csrf/\"><span class=\"doc\">Cross Site Request Forgery protection</span></a>.</p>\n</section>\n<section id=\"csrf-cookie-path\">\n<span id=\"std-setting-CSRF_COOKIE_PATH\"></span><h3><code class=\"docutils literal notranslate\">CSRF_COOKIE_PATH</code><a class=\"heading-anchor\" href=\"#csrf-cookie-path\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h3>\n<p>Default: <code class=\"docutils literal notranslate\">'/'</code></p>\n<p>The path set on the CSRF cookie. This should either match the URL path of your\nDjango installation or be a parent of that path.</p>\n<p>This is useful if you have multiple Django instances running under the same\nhostname. They can use different cookie paths, and each instance will only see\nits own CSRF cookie.</p>\n</section>\n<section id=\"csrf-cookie-samesite\">\n<span id=\"std-setting-CSRF_COOKIE_SAMESITE\"></span><h3><code class=\"docutils literal notranslate\">CSRF_COOKIE_SAMESITE</code><a class=\"heading-anchor\" href=\"#csrf-cookie-samesite\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h3>\n<p>Default: <code class=\"docutils literal notranslate\">'Lax'</code></p>\n<p>The value of the <a class=\"reference external\" href=\"https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Set-Cookie/SameSite\">SameSite</a> flag on the CSRF cookie. This flag prevents the\ncookie from being sent in cross-site requests.</p>\n<p>See <a class=\"reference internal\" href=\"#std-setting-SESSION_COOKIE_SAMESITE\"><code class=\"xref std std-setting docutils literal notranslate\">SESSION_COOKIE_SAMESITE</code></a> for details about <code class=\"docutils literal notranslate\">SameSite</code>.</p>\n</section>\n<section id=\"csrf-cookie-secure\">\n<span id=\"std-setting-CSRF_COOKIE_SECURE\"></span><h3><code class=\"docutils literal notranslate\">CSRF_COOKIE_SECURE</code><a class=\"heading-anchor\" href=\"#csrf-cookie-secure\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h3>\n<p>Default: <code class=\"docutils literal notranslate\">False</code></p>\n<p>Whether to use a secure cookie for the CSRF cookie. If this is set to <code class=\"docutils literal notranslate\">True</code>,\nthe cookie will be marked as «secure», which means browsers may ensure that the\ncookie is only sent with an HTTPS connection.</p>\n</section>\n<section id=\"csrf-use-sessions\">\n<span id=\"std-setting-CSRF_USE_SESSIONS\"></span><h3><code class=\"docutils literal notranslate\">CSRF_USE_SESSIONS</code><a class=\"heading-anchor\" href=\"#csrf-use-sessions\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h3>\n<p>Default: <code class=\"docutils literal notranslate\">False</code></p>\n<p>Whether to store the CSRF token in the user’s session instead of in a cookie.\nIt requires the use of <a class=\"reference internal\" href=\"/it/4.1/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>.</p>\n<p>Storing the CSRF token in a cookie (Django’s default) is safe, but storing it\nin the session is common practice in other web frameworks and therefore\nsometimes demanded by security auditors.</p>\n<p>Since the <a class=\"reference internal\" href=\"/it/4.1/ref/views/#error-views\"><span class=\"std std-ref\">default error views</span></a> require the CSRF token,\n<a class=\"reference internal\" href=\"/it/4.1/ref/middleware/#django.contrib.sessions.middleware.SessionMiddleware\" title=\"django.contrib.sessions.middleware.SessionMiddleware\"><code class=\"xref py py-class docutils literal notranslate\">SessionMiddleware</code></a> must appear in\n<a class=\"reference internal\" href=\"#std-setting-MIDDLEWARE\"><code class=\"xref std std-setting docutils literal notranslate\">MIDDLEWARE</code></a> before any middleware that may raise an exception to\ntrigger an error view (such as <a class=\"reference internal\" href=\"/it/4.1/ref/exceptions/#django.core.exceptions.PermissionDenied\" title=\"django.core.exceptions.PermissionDenied\"><code class=\"xref py py-exc docutils literal notranslate\">PermissionDenied</code></a>)\nif you’re using <code class=\"docutils literal notranslate\">CSRF_USE_SESSIONS</code>. See <a class=\"reference internal\" href=\"/it/4.1/ref/middleware/#middleware-ordering\"><span class=\"std std-ref\">Middleware ordering</span></a>.</p>\n</section>\n<section id=\"csrf-failure-view\">\n<span id=\"std-setting-CSRF_FAILURE_VIEW\"></span><h3><code class=\"docutils literal notranslate\">CSRF_FAILURE_VIEW</code><a class=\"heading-anchor\" href=\"#csrf-failure-view\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h3>\n<p>Default: <code class=\"docutils literal notranslate\">'django.views.csrf.csrf_failure'</code></p>\n<p>A dotted path to the view function to be used when an incoming request is\nrejected by the <a class=\"reference internal\" href=\"/it/4.1/ref/csrf/\"><span class=\"doc\">CSRF protection</span></a>. The function should have\nthis signature:</p>\n<div class=\"code-block\" data-language=\"default\"><div class=\"code-block-toolbar\"><span class=\"code-block-language\">Code</span><button type=\"button\" class=\"copy-button\" data-copy hidden><span class=\"copy-button-label\">Copy</span></button></div><pre role=\"group\" tabindex=\"0\" aria-label=\"Code code\"><code><span class=\"k\">def</span> <span class=\"nf\">csrf_failure</span><span class=\"p\">(</span>request<span class=\"p\">,</span> reason<span class=\"o\">=</span><span class=\"s2\">&quot;&quot;</span><span class=\"p\">):</span>\n    <span class=\"o\">...</span>\n</code></pre></div>\n<p>where <code class=\"docutils literal notranslate\">reason</code> is a short message (intended for developers or logging, not\nfor end users) indicating the reason the request was rejected. It should return\nan <a class=\"reference internal\" href=\"/it/4.1/ref/request-response/#django.http.HttpResponseForbidden\" title=\"django.http.HttpResponseForbidden\"><code class=\"xref py py-class docutils literal notranslate\">HttpResponseForbidden</code></a>.</p>\n<p><code class=\"docutils literal notranslate\">django.views.csrf.csrf_failure()</code> accepts an additional <code class=\"docutils literal notranslate\">template_name</code>\nparameter that defaults to <code class=\"docutils literal notranslate\">'403_csrf.html'</code>. If a template with that name\nexists, it will be used to render the page.</p>\n</section>\n<section id=\"csrf-header-name\">\n<span id=\"std-setting-CSRF_HEADER_NAME\"></span><h3><code class=\"docutils literal notranslate\">CSRF_HEADER_NAME</code><a class=\"heading-anchor\" href=\"#csrf-header-name\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h3>\n<p>Default: <code class=\"docutils literal notranslate\">'HTTP_X_CSRFTOKEN'</code></p>\n<p>The name of the request header used for CSRF authentication.</p>\n<p>As with other HTTP headers in <code class=\"docutils literal notranslate\">request.META</code>, the header name received from\nthe server is normalized by converting all characters to uppercase, replacing\nany hyphens with underscores, and adding an <code class=\"docutils literal notranslate\">'HTTP_'</code> prefix to the name.\nFor example, if your client sends a <code class=\"docutils literal notranslate\">'X-XSRF-TOKEN'</code> header, the setting\nshould be <code class=\"docutils literal notranslate\">'HTTP_X_XSRF_TOKEN'</code>.</p>\n</section>\n<section id=\"csrf-trusted-origins\">\n<span id=\"std-setting-CSRF_TRUSTED_ORIGINS\"></span><h3><code class=\"docutils literal notranslate\">CSRF_TRUSTED_ORIGINS</code><a class=\"heading-anchor\" href=\"#csrf-trusted-origins\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h3>\n<p>Default: <code class=\"docutils literal notranslate\">[]</code> (Empty list)</p>\n<p>A list of trusted origins for unsafe requests (e.g. <code class=\"docutils literal notranslate\">POST</code>).</p>\n<p>For requests that include the <code class=\"docutils literal notranslate\">Origin</code> header, Django’s CSRF protection\nrequires that header match the origin present in the <code class=\"docutils literal notranslate\">Host</code> header.</p>\n<p>For a <a class=\"reference internal\" href=\"/it/4.1/ref/request-response/#django.http.HttpRequest.is_secure\" title=\"django.http.HttpRequest.is_secure\"><code class=\"xref py py-meth docutils literal notranslate\">secure</code></a> unsafe\nrequest that doesn’t include the <code class=\"docutils literal notranslate\">Origin</code> header, the request must have a\n<code class=\"docutils literal notranslate\">Referer</code> header that matches the origin present in the <code class=\"docutils literal notranslate\">Host</code> header.</p>\n<p>These checks prevent, for example, a <code class=\"docutils literal notranslate\">POST</code> request from\n<code class=\"docutils literal notranslate\">subdomain.example.com</code> from succeeding against <code class=\"docutils literal notranslate\">api.example.com</code>. If you\nneed cross-origin unsafe requests, continuing the example, add\n<code class=\"docutils literal notranslate\">'https://subdomain.example.com'</code> to this list (and/or <code class=\"docutils literal notranslate\">http://...</code> if\nrequests originate from an insecure page).</p>\n<p>The setting also supports subdomains, so you could add\n<code class=\"docutils literal notranslate\">'https://*.example.com'</code>, for example, to allow access from all subdomains\nof <code class=\"docutils literal notranslate\">example.com</code>.</p>\n<aside class=\"version-note version-changed\" data-version=\"4.0\" role=\"note\">\n<p class=\"version-note-title\">Changed in Django 4.0</p><p>The values in older versions must only include the hostname (possibly with\na leading dot) and not the scheme or an asterisk.</p>\n<p>Also, <code class=\"docutils literal notranslate\">Origin</code> header checking isn’t performed in older versions.</p>\n</aside>\n</section>\n<section id=\"databases\">\n<span id=\"std-setting-DATABASES\"></span><h3><code class=\"docutils literal notranslate\">DATABASES</code><a class=\"heading-anchor\" href=\"#databases\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h3>\n<p>Default: <code class=\"docutils literal notranslate\">{}</code> (Empty dictionary)</p>\n<p>A dictionary containing the settings for all databases to be used with\nDjango. It is a nested dictionary whose contents map a database alias\nto a dictionary containing the options for an individual database.</p>\n<p>The <a class=\"reference internal\" href=\"#std-setting-DATABASES\"><code class=\"xref std std-setting docutils literal notranslate\">DATABASES</code></a> setting must configure a <code class=\"docutils literal notranslate\">default</code> database;\nany number of additional databases may also be specified.</p>\n<p>The simplest possible settings file is for a single-database setup using\nSQLite. This can be configured using the following:</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>DATABASES <span class=\"o\">=</span> <span class=\"p\">{</span>\n    <span class=\"s1\">&#39;default&#39;</span><span class=\"p\">:</span> <span class=\"p\">{</span>\n        <span class=\"s1\">&#39;ENGINE&#39;</span><span class=\"p\">:</span> <span class=\"s1\">&#39;django.db.backends.sqlite3&#39;</span><span class=\"p\">,</span>\n        <span class=\"s1\">&#39;NAME&#39;</span><span class=\"p\">:</span> <span class=\"s1\">&#39;mydatabase&#39;</span><span class=\"p\">,</span>\n    <span class=\"p\">}</span>\n<span class=\"p\">}</span>\n</code></pre></div>\n<p>When connecting to other database backends, such as MariaDB, MySQL, Oracle, or\nPostgreSQL, additional connection parameters will be required. See\nthe <a class=\"reference internal\" href=\"#std-setting-DATABASE-ENGINE\"><code class=\"xref std std-setting docutils literal notranslate\">ENGINE</code></a> setting below on how to specify\nother database types. This example is for PostgreSQL:</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>DATABASES <span class=\"o\">=</span> <span class=\"p\">{</span>\n    <span class=\"s1\">&#39;default&#39;</span><span class=\"p\">:</span> <span class=\"p\">{</span>\n        <span class=\"s1\">&#39;ENGINE&#39;</span><span class=\"p\">:</span> <span class=\"s1\">&#39;django.db.backends.postgresql&#39;</span><span class=\"p\">,</span>\n        <span class=\"s1\">&#39;NAME&#39;</span><span class=\"p\">:</span> <span class=\"s1\">&#39;mydatabase&#39;</span><span class=\"p\">,</span>\n        <span class=\"s1\">&#39;USER&#39;</span><span class=\"p\">:</span> <span class=\"s1\">&#39;mydatabaseuser&#39;</span><span class=\"p\">,</span>\n        <span class=\"s1\">&#39;PASSWORD&#39;</span><span class=\"p\">:</span> <span class=\"s1\">&#39;mypassword&#39;</span><span class=\"p\">,</span>\n        <span class=\"s1\">&#39;HOST&#39;</span><span class=\"p\">:</span> <span class=\"s1\">&#39;127.0.0.1&#39;</span><span class=\"p\">,</span>\n        <span class=\"s1\">&#39;PORT&#39;</span><span class=\"p\">:</span> <span class=\"s1\">&#39;5432&#39;</span><span class=\"p\">,</span>\n    <span class=\"p\">}</span>\n<span class=\"p\">}</span>\n</code></pre></div>\n<p>The following inner options that may be required for more complex\nconfigurations are available:</p>\n<section id=\"atomic-requests\">\n<span id=\"std-setting-DATABASE-ATOMIC_REQUESTS\"></span><h4><code class=\"docutils literal notranslate\">ATOMIC_REQUESTS</code><a class=\"heading-anchor\" href=\"#atomic-requests\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h4>\n<p>Default: <code class=\"docutils literal notranslate\">False</code></p>\n<p>Set this to <code class=\"docutils literal notranslate\">True</code> to wrap each view in a transaction on this database. See\n<a class=\"reference internal\" href=\"/it/4.1/topics/db/transactions/#tying-transactions-to-http-requests\"><span class=\"std std-ref\">Tying transactions to HTTP requests</span></a>.</p>\n</section>\n<section id=\"autocommit\">\n<span id=\"std-setting-DATABASE-AUTOCOMMIT\"></span><h4><code class=\"docutils literal notranslate\">AUTOCOMMIT</code><a class=\"heading-anchor\" href=\"#autocommit\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h4>\n<p>Default: <code class=\"docutils literal notranslate\">True</code></p>\n<p>Set this to <code class=\"docutils literal notranslate\">False</code> if you want to <a class=\"reference internal\" href=\"/it/4.1/topics/db/transactions/#deactivate-transaction-management\"><span class=\"std std-ref\">disable Django’s transaction\nmanagement</span></a> and implement your own.</p>\n</section>\n<section id=\"engine\">\n<span id=\"std-setting-DATABASE-ENGINE\"></span><h4><code class=\"docutils literal notranslate\">ENGINE</code><a class=\"heading-anchor\" href=\"#engine\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h4>\n<p>Default: <code class=\"docutils literal notranslate\">''</code> (Empty string)</p>\n<p>The database backend to use. The built-in database backends are:</p>\n<ul class=\"simple\">\n<li><p><code class=\"docutils literal notranslate\">'django.db.backends.postgresql'</code></p></li>\n<li><p><code class=\"docutils literal notranslate\">'django.db.backends.mysql'</code></p></li>\n<li><p><code class=\"docutils literal notranslate\">'django.db.backends.sqlite3'</code></p></li>\n<li><p><code class=\"docutils literal notranslate\">'django.db.backends.oracle'</code></p></li>\n</ul>\n<p>You can use a database backend that doesn’t ship with Django by setting\n<code class=\"docutils literal notranslate\">ENGINE</code> to a fully-qualified path (i.e. <code class=\"docutils literal notranslate\">mypackage.backends.whatever</code>).</p>\n</section>\n<section id=\"host\">\n<span id=\"std-setting-HOST\"></span><h4><code class=\"docutils literal notranslate\">HOST</code><a class=\"heading-anchor\" href=\"#host\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h4>\n<p>Default: <code class=\"docutils literal notranslate\">''</code> (Empty string)</p>\n<p>Which host to use when connecting to the database. An empty string means\nlocalhost. Not used with SQLite.</p>\n<p>If this value starts with a forward slash (<code class=\"docutils literal notranslate\">'/'</code>) and you’re using MySQL,\nMySQL will connect via a Unix socket to the specified socket. For example:</p>\n<div class=\"code-block\" data-language=\"default\"><div class=\"code-block-toolbar\"><span class=\"code-block-language\">Code</span><button type=\"button\" class=\"copy-button\" data-copy hidden><span class=\"copy-button-label\">Copy</span></button></div><pre role=\"group\" tabindex=\"0\" aria-label=\"Code code\"><code><span class=\"s2\">&quot;HOST&quot;</span><span class=\"p\">:</span> <span class=\"s1\">&#39;/var/run/mysql&#39;</span>\n</code></pre></div>\n<p>If you’re using MySQL and this value <em>doesn’t</em> start with a forward slash, then\nthis value is assumed to be the host.</p>\n<p>If you’re using PostgreSQL, by default (empty <a class=\"reference internal\" href=\"#std-setting-HOST\"><code class=\"xref std std-setting docutils literal notranslate\">HOST</code></a>), the connection\nto the database is done through UNIX domain sockets (“local” lines in\n<code class=\"docutils literal notranslate\">pg_hba.conf</code>). If your UNIX domain socket is not in the standard location,\nuse the same value of <code class=\"docutils literal notranslate\">unix_socket_directory</code> from <code class=\"docutils literal notranslate\">postgresql.conf</code>.\nIf you want to connect through TCP sockets, set <a class=\"reference internal\" href=\"#std-setting-HOST\"><code class=\"xref std std-setting docutils literal notranslate\">HOST</code></a> to “localhost”\nor “127.0.0.1” (“host” lines in <code class=\"docutils literal notranslate\">pg_hba.conf</code>).\nOn Windows, you should always define <a class=\"reference internal\" href=\"#std-setting-HOST\"><code class=\"xref std std-setting docutils literal notranslate\">HOST</code></a>, as UNIX domain sockets\nare not available.</p>\n</section>\n<section id=\"name\">\n<span id=\"std-setting-NAME\"></span><h4><code class=\"docutils literal notranslate\">NAME</code><a class=\"heading-anchor\" href=\"#name\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h4>\n<p>Default: <code class=\"docutils literal notranslate\">''</code> (Empty string)</p>\n<p>The name of the database to use. For SQLite, it’s the full path to the database\nfile. When specifying the path, always use forward slashes, even on Windows\n(e.g. <code class=\"docutils literal notranslate\">C:/homes/user/mysite/sqlite3.db</code>).</p>\n</section>\n<section id=\"conn-max-age\">\n<span id=\"std-setting-CONN_MAX_AGE\"></span><h4><code class=\"docutils literal notranslate\">CONN_MAX_AGE</code><a class=\"heading-anchor\" href=\"#conn-max-age\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h4>\n<p>Default: <code class=\"docutils literal notranslate\">0</code></p>\n<p>The lifetime of a database connection, as an integer of seconds. Use <code class=\"docutils literal notranslate\">0</code> to\nclose database connections at the end of each request — Django’s historical\nbehavior — and <code class=\"docutils literal notranslate\">None</code> for unlimited <a class=\"reference internal\" href=\"/it/4.1/ref/databases/#persistent-database-connections\"><span class=\"std std-ref\">persistent database connections</span></a>.</p>\n</section>\n<section id=\"conn-health-checks\">\n<span id=\"std-setting-CONN_HEALTH_CHECKS\"></span><h4><code class=\"docutils literal notranslate\">CONN_HEALTH_CHECKS</code><a class=\"heading-anchor\" href=\"#conn-health-checks\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h4>\n<aside class=\"version-note version-added\" data-version=\"4.1\" role=\"note\">\n<p class=\"version-note-title\">New in Django 4.1</p></aside>\n<p>Default: <code class=\"docutils literal notranslate\">False</code></p>\n<p>If set to <code class=\"docutils literal notranslate\">True</code>, existing <a class=\"reference internal\" href=\"/it/4.1/ref/databases/#persistent-database-connections\"><span class=\"std std-ref\">persistent database connections</span></a> will be health checked before they are\nreused in each request performing database access. If the health check fails,\nthe connection will be reestablished without failing the request when the\nconnection is no longer usable but the database server is ready to accept and\nserve new connections (e.g. after database server restart closing existing\nconnections).</p>\n</section>\n<section id=\"std-setting-OPTIONS\">\n<span id=\"id1\"></span><h4><code class=\"docutils literal notranslate\">OPTIONS</code><a class=\"heading-anchor\" href=\"#std-setting-OPTIONS\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h4>\n<p>Default: <code class=\"docutils literal notranslate\">{}</code> (Empty dictionary)</p>\n<p>Extra parameters to use when connecting to the database. Available parameters\nvary depending on your database backend.</p>\n<p>Some information on available parameters can be found in the\n<a class=\"reference internal\" href=\"/it/4.1/ref/databases/\"><span class=\"doc\">Database Backends</span></a> documentation. For more information,\nconsult your backend module’s own documentation.</p>\n</section>\n<section id=\"password\">\n<span id=\"std-setting-PASSWORD\"></span><h4><code class=\"docutils literal notranslate\">PASSWORD</code><a class=\"heading-anchor\" href=\"#password\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h4>\n<p>Default: <code class=\"docutils literal notranslate\">''</code> (Empty string)</p>\n<p>The password to use when connecting to the database. Not used with SQLite.</p>\n</section>\n<section id=\"port\">\n<span id=\"std-setting-PORT\"></span><h4><code class=\"docutils literal notranslate\">PORT</code><a class=\"heading-anchor\" href=\"#port\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h4>\n<p>Default: <code class=\"docutils literal notranslate\">''</code> (Empty string)</p>\n<p>The port to use when connecting to the database. An empty string means the\ndefault port. Not used with SQLite.</p>\n</section>\n<section id=\"time-zone\">\n<span id=\"std-setting-DATABASE-TIME_ZONE\"></span><h4><code class=\"docutils literal notranslate\">TIME_ZONE</code><a class=\"heading-anchor\" href=\"#time-zone\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h4>\n<p>Default: <code class=\"docutils literal notranslate\">None</code></p>\n<p>A string representing the time zone for this database connection or <code class=\"docutils literal notranslate\">None</code>.\nThis inner option of the <a class=\"reference internal\" href=\"#std-setting-DATABASES\"><code class=\"xref std std-setting docutils literal notranslate\">DATABASES</code></a> setting accepts the same values\nas the general <a class=\"reference internal\" href=\"#std-setting-TIME_ZONE\"><code class=\"xref std std-setting docutils literal notranslate\">TIME_ZONE</code></a> setting.</p>\n<p>When <a class=\"reference internal\" href=\"#std-setting-USE_TZ\"><code class=\"xref std std-setting docutils literal notranslate\">USE_TZ</code></a> is <code class=\"docutils literal notranslate\">True</code> and this option is set, reading datetimes\nfrom the database returns aware datetimes in this time zone instead of UTC.\nWhen <a class=\"reference internal\" href=\"#std-setting-USE_TZ\"><code class=\"xref std std-setting docutils literal notranslate\">USE_TZ</code></a> is <code class=\"docutils literal notranslate\">False</code>, it is an error to set this option.</p>\n<ul>\n<li><p>If the database backend doesn’t support time zones (e.g. SQLite, MySQL,\nOracle), Django reads and writes datetimes in local time according to this\noption if it is set and in UTC if it isn’t.</p>\n<p>Changing the connection time zone changes how datetimes are read from and\nwritten to the database.</p>\n<ul class=\"simple\">\n<li><p>If Django manages the database and you don’t have a strong reason to do\notherwise, you should leave this option unset. It’s best to store datetimes\nin UTC because it avoids ambiguous or nonexistent datetimes during daylight\nsaving time changes. Also, receiving datetimes in UTC keeps datetime\narithmetic simple — there’s no need to consider potential offset changes\nover a DST transition.</p></li>\n<li><p>If you’re connecting to a third-party database that stores datetimes in a\nlocal time rather than UTC, then you must set this option to the\nappropriate time zone. Likewise, if Django manages the database but\nthird-party systems connect to the same database and expect to find\ndatetimes in local time, then you must set this option.</p></li>\n</ul>\n</li>\n<li><p>If the database backend supports time zones (e.g. PostgreSQL), the\n<code class=\"docutils literal notranslate\">TIME_ZONE</code> option is very rarely needed. It can be changed at any time;\nthe database takes care of converting datetimes to the desired time zone.</p>\n<p>Setting the time zone of the database connection may be useful for running\nraw SQL queries involving date/time functions provided by the database, such\nas <code class=\"docutils literal notranslate\">date_trunc</code>, because their results depend on the time zone.</p>\n<p>However, this has a downside: receiving all datetimes in local time makes\ndatetime arithmetic more tricky — you must account for possible offset\nchanges over DST transitions.</p>\n<p>Consider converting to local time explicitly with <code class=\"docutils literal notranslate\">AT TIME ZONE</code> in raw SQL\nqueries instead of setting the <code class=\"docutils literal notranslate\">TIME_ZONE</code> option.</p>\n</li>\n</ul>\n</section>\n<section id=\"disable-server-side-cursors\">\n<span id=\"std-setting-DATABASE-DISABLE_SERVER_SIDE_CURSORS\"></span><h4><code class=\"docutils literal notranslate\">DISABLE_SERVER_SIDE_CURSORS</code><a class=\"heading-anchor\" href=\"#disable-server-side-cursors\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h4>\n<p>Default: <code class=\"docutils literal notranslate\">False</code></p>\n<p>Set this to <code class=\"docutils literal notranslate\">True</code> if you want to disable the use of server-side cursors with\n<a class=\"reference internal\" href=\"/it/4.1/ref/models/querysets/#django.db.models.query.QuerySet.iterator\" title=\"django.db.models.query.QuerySet.iterator\"><code class=\"xref py py-meth docutils literal notranslate\">QuerySet.iterator()</code></a>. <a class=\"reference internal\" href=\"/it/4.1/ref/databases/#transaction-pooling-server-side-cursors\"><span class=\"std std-ref\">Transaction pooling and server-side cursors</span></a>\ndescribes the use case.</p>\n<p>This is a PostgreSQL-specific setting.</p>\n</section>\n<section id=\"user\">\n<span id=\"std-setting-USER\"></span><h4><code class=\"docutils literal notranslate\">USER</code><a class=\"heading-anchor\" href=\"#user\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h4>\n<p>Default: <code class=\"docutils literal notranslate\">''</code> (Empty string)</p>\n<p>The username to use when connecting to the database. Not used with SQLite.</p>\n</section>\n<section id=\"test\">\n<span id=\"std-setting-DATABASE-TEST\"></span><h4><code class=\"docutils literal notranslate\">TEST</code><a class=\"heading-anchor\" href=\"#test\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h4>\n<p>Default: <code class=\"docutils literal notranslate\">{}</code> (Empty dictionary)</p>\n<p>A dictionary of settings for test databases; for more details about the\ncreation and use of test databases, see <a class=\"reference internal\" href=\"/it/4.1/topics/testing/overview/#the-test-database\"><span class=\"std std-ref\">The test database</span></a>.</p>\n<p>Here’s an example with a test database configuration:</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>DATABASES <span class=\"o\">=</span> <span class=\"p\">{</span>\n    <span class=\"s1\">&#39;default&#39;</span><span class=\"p\">:</span> <span class=\"p\">{</span>\n        <span class=\"s1\">&#39;ENGINE&#39;</span><span class=\"p\">:</span> <span class=\"s1\">&#39;django.db.backends.postgresql&#39;</span><span class=\"p\">,</span>\n        <span class=\"s1\">&#39;USER&#39;</span><span class=\"p\">:</span> <span class=\"s1\">&#39;mydatabaseuser&#39;</span><span class=\"p\">,</span>\n        <span class=\"s1\">&#39;NAME&#39;</span><span class=\"p\">:</span> <span class=\"s1\">&#39;mydatabase&#39;</span><span class=\"p\">,</span>\n        <span class=\"s1\">&#39;TEST&#39;</span><span class=\"p\">:</span> <span class=\"p\">{</span>\n            <span class=\"s1\">&#39;NAME&#39;</span><span class=\"p\">:</span> <span class=\"s1\">&#39;mytestdatabase&#39;</span><span class=\"p\">,</span>\n        <span class=\"p\">},</span>\n    <span class=\"p\">},</span>\n<span class=\"p\">}</span>\n</code></pre></div>\n<p>The following keys in the <code class=\"docutils literal notranslate\">TEST</code> dictionary are available:</p>\n<section id=\"charset\">\n<span id=\"std-setting-TEST_CHARSET\"></span><h5><code class=\"docutils literal notranslate\">CHARSET</code><a class=\"heading-anchor\" href=\"#charset\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h5>\n<p>Default: <code class=\"docutils literal notranslate\">None</code></p>\n<p>The character set encoding used to create the test database. The value of this\nstring is passed directly through to the database, so its format is\nbackend-specific.</p>\n<p>Supported by the <a class=\"reference external\" href=\"https://www.postgresql.org/docs/current/multibyte.html\">PostgreSQL</a> (<code class=\"docutils literal notranslate\">postgresql</code>) and <a class=\"reference external\" href=\"https://dev.mysql.com/doc/refman/en/charset-charsets.html\">MySQL</a> (<code class=\"docutils literal notranslate\">mysql</code>) backends.</p>\n</section>\n<section id=\"collation\">\n<span id=\"std-setting-TEST_COLLATION\"></span><h5><code class=\"docutils literal notranslate\">COLLATION</code><a class=\"heading-anchor\" href=\"#collation\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h5>\n<p>Default: <code class=\"docutils literal notranslate\">None</code></p>\n<p>The collation order to use when creating the test database. This value is\npassed directly to the backend, so its format is backend-specific.</p>\n<p>Only supported for the <code class=\"docutils literal notranslate\">mysql</code> backend (see the <a class=\"reference external\" href=\"https://dev.mysql.com/doc/refman/en/charset-charsets.html\">MySQL manual</a> for details).</p>\n</section>\n<section id=\"dependencies\">\n<span id=\"std-setting-TEST_DEPENDENCIES\"></span><h5><code class=\"docutils literal notranslate\">DEPENDENCIES</code><a class=\"heading-anchor\" href=\"#dependencies\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h5>\n<p>Default: <code class=\"docutils literal notranslate\">['default']</code>, for all databases other than <code class=\"docutils literal notranslate\">default</code>,\nwhich has no dependencies.</p>\n<p>The creation-order dependencies of the database. See the documentation\non <a class=\"reference internal\" href=\"/it/4.1/topics/testing/advanced/#topics-testing-creation-dependencies\"><span class=\"std std-ref\">controlling the creation order of test databases</span></a> for details.</p>\n</section>\n<section id=\"migrate\">\n<span id=\"std-setting-TEST_MIGRATE\"></span><h5><code class=\"docutils literal notranslate\">MIGRATE</code><a class=\"heading-anchor\" href=\"#migrate\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h5>\n<p>Default: <code class=\"docutils literal notranslate\">True</code></p>\n<p>When set to <code class=\"docutils literal notranslate\">False</code>, migrations won’t run when creating the test database.\nThis is similar to setting <code class=\"docutils literal notranslate\">None</code> as a value in <a class=\"reference internal\" href=\"#std-setting-MIGRATION_MODULES\"><code class=\"xref std std-setting docutils literal notranslate\">MIGRATION_MODULES</code></a>,\nbut for all apps.</p>\n</section>\n<section id=\"mirror\">\n<span id=\"std-setting-TEST_MIRROR\"></span><h5><code class=\"docutils literal notranslate\">MIRROR</code><a class=\"heading-anchor\" href=\"#mirror\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h5>\n<p>Default: <code class=\"docutils literal notranslate\">None</code></p>\n<p>The alias of the database that this database should mirror during\ntesting. It depends on transactions and therefore must be used within\n<a class=\"reference internal\" href=\"/it/4.1/topics/testing/tools/#django.test.TransactionTestCase\" title=\"django.test.TransactionTestCase\"><code class=\"xref py py-class docutils literal notranslate\">TransactionTestCase</code></a> instead of\n<a class=\"reference internal\" href=\"/it/4.1/topics/testing/tools/#django.test.TestCase\" title=\"django.test.TestCase\"><code class=\"xref py py-class docutils literal notranslate\">TestCase</code></a>.</p>\n<p>This setting exists to allow for testing of primary/replica\n(referred to as master/slave by some databases)\nconfigurations of multiple databases. See the documentation on\n<a class=\"reference internal\" href=\"/it/4.1/topics/testing/advanced/#topics-testing-primaryreplica\"><span class=\"std std-ref\">testing primary/replica configurations</span></a> for details.</p>\n</section>\n<section id=\"std-setting-TEST_NAME\">\n<span id=\"id2\"></span><h5><code class=\"docutils literal notranslate\">NAME</code><a class=\"heading-anchor\" href=\"#std-setting-TEST_NAME\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h5>\n<p>Default: <code class=\"docutils literal notranslate\">None</code></p>\n<p>The name of database to use when running the test suite.</p>\n<p>If the default value (<code class=\"docutils literal notranslate\">None</code>) is used with the SQLite database engine, the\ntests will use a memory resident database. For all other database engines the\ntest database will use the name <code class=\"docutils literal notranslate\">'test_' + DATABASE_NAME</code>.</p>\n<p>See <a class=\"reference internal\" href=\"/it/4.1/topics/testing/overview/#the-test-database\"><span class=\"std std-ref\">The test database</span></a>.</p>\n</section>\n<section id=\"serialize\">\n<span id=\"std-setting-TEST_SERIALIZE\"></span><h5><code class=\"docutils literal notranslate\">SERIALIZE</code><a class=\"heading-anchor\" href=\"#serialize\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h5>\n<p>Boolean value to control whether or not the default test runner serializes the\ndatabase into an in-memory JSON string before running tests (used to restore\nthe database state between tests if you don’t have transactions). You can set\nthis to <code class=\"docutils literal notranslate\">False</code> to speed up creation time if you don’t have any test classes\nwith <a class=\"reference internal\" href=\"/it/4.1/topics/testing/overview/#test-case-serialized-rollback\"><span class=\"std std-ref\">serialized_rollback=True</span></a>.</p>\n<aside class=\"version-note version-deprecated\" data-version=\"4.0\" role=\"note\">\n<p class=\"version-note-title\">Deprecated since Django 4.0</p><p><span class=\"versionmodified deprecated\">Deprecato dalla versione 4.0: </span>This setting is deprecated as it can be inferred from the\n<a class=\"reference internal\" href=\"/it/4.1/topics/testing/tools/#django.test.TestCase.databases\" title=\"django.test.TestCase.databases\"><code class=\"xref py py-attr docutils literal notranslate\">databases</code></a> with the\n<a class=\"reference internal\" href=\"/it/4.1/topics/testing/overview/#test-case-serialized-rollback\"><span class=\"std std-ref\">serialized_rollback</span></a> option enabled.</p>\n</aside>\n</section>\n<section id=\"template\">\n<span id=\"std-setting-TEST_TEMPLATE\"></span><h5><code class=\"docutils literal notranslate\">TEMPLATE</code><a class=\"heading-anchor\" href=\"#template\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h5>\n<p>This is a PostgreSQL-specific setting.</p>\n<p>The name of a <a class=\"reference external\" href=\"https://www.postgresql.org/docs/current/sql-createdatabase.html\">template</a> (e.g. <code class=\"docutils literal notranslate\">'template0'</code>) from which to create the test\ndatabase.</p>\n</section>\n<section id=\"create-db\">\n<span id=\"std-setting-TEST_CREATE\"></span><h5><code class=\"docutils literal notranslate\">CREATE_DB</code><a class=\"heading-anchor\" href=\"#create-db\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h5>\n<p>Default: <code class=\"docutils literal notranslate\">True</code></p>\n<p>This is an Oracle-specific setting.</p>\n<p>If it is set to <code class=\"docutils literal notranslate\">False</code>, the test tablespaces won’t be automatically created\nat the beginning of the tests or dropped at the end.</p>\n</section>\n<section id=\"create-user\">\n<span id=\"std-setting-TEST_USER_CREATE\"></span><h5><code class=\"docutils literal notranslate\">CREATE_USER</code><a class=\"heading-anchor\" href=\"#create-user\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h5>\n<p>Default: <code class=\"docutils literal notranslate\">True</code></p>\n<p>This is an Oracle-specific setting.</p>\n<p>If it is set to <code class=\"docutils literal notranslate\">False</code>, the test user won’t be automatically created at the\nbeginning of the tests and dropped at the end.</p>\n</section>\n<section id=\"std-setting-TEST_USER\">\n<span id=\"id4\"></span><h5><code class=\"docutils literal notranslate\">USER</code><a class=\"heading-anchor\" href=\"#std-setting-TEST_USER\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h5>\n<p>Default: <code class=\"docutils literal notranslate\">None</code></p>\n<p>This is an Oracle-specific setting.</p>\n<p>The username to use when connecting to the Oracle database that will be used\nwhen running tests. If not provided, Django will use <code class=\"docutils literal notranslate\">'test_' + USER</code>.</p>\n</section>\n<section id=\"std-setting-TEST_PASSWD\">\n<span id=\"id5\"></span><h5><code class=\"docutils literal notranslate\">PASSWORD</code><a class=\"heading-anchor\" href=\"#std-setting-TEST_PASSWD\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h5>\n<p>Default: <code class=\"docutils literal notranslate\">None</code></p>\n<p>This is an Oracle-specific setting.</p>\n<p>The password to use when connecting to the Oracle database that will be used\nwhen running tests. If not provided, Django will generate a random password.</p>\n</section>\n<section id=\"oracle-managed-files\">\n<span id=\"std-setting-TEST_ORACLE_MANAGED_FILES\"></span><h5><code class=\"docutils literal notranslate\">ORACLE_MANAGED_FILES</code><a class=\"heading-anchor\" href=\"#oracle-managed-files\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h5>\n<p>Default: <code class=\"docutils literal notranslate\">False</code></p>\n<p>This is an Oracle-specific setting.</p>\n<p>If set to <code class=\"docutils literal notranslate\">True</code>, Oracle Managed Files (OMF) tablespaces will be used.\n<a class=\"reference internal\" href=\"#std-setting-DATAFILE\"><code class=\"xref std std-setting docutils literal notranslate\">DATAFILE</code></a> and <a class=\"reference internal\" href=\"#std-setting-DATAFILE_TMP\"><code class=\"xref std std-setting docutils literal notranslate\">DATAFILE_TMP</code></a> will be ignored.</p>\n</section>\n<section id=\"tblspace\">\n<span id=\"std-setting-TEST_TBLSPACE\"></span><h5><code class=\"docutils literal notranslate\">TBLSPACE</code><a class=\"heading-anchor\" href=\"#tblspace\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h5>\n<p>Default: <code class=\"docutils literal notranslate\">None</code></p>\n<p>This is an Oracle-specific setting.</p>\n<p>The name of the tablespace that will be used when running tests. If not\nprovided, Django will use <code class=\"docutils literal notranslate\">'test_' + USER</code>.</p>\n</section>\n<section id=\"tblspace-tmp\">\n<span id=\"std-setting-TEST_TBLSPACE_TMP\"></span><h5><code class=\"docutils literal notranslate\">TBLSPACE_TMP</code><a class=\"heading-anchor\" href=\"#tblspace-tmp\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h5>\n<p>Default: <code class=\"docutils literal notranslate\">None</code></p>\n<p>This is an Oracle-specific setting.</p>\n<p>The name of the temporary tablespace that will be used when running tests. If\nnot provided, Django will use <code class=\"docutils literal notranslate\">'test_' + USER + '_temp'</code>.</p>\n</section>\n<section id=\"datafile\">\n<span id=\"std-setting-DATAFILE\"></span><h5><code class=\"docutils literal notranslate\">DATAFILE</code><a class=\"heading-anchor\" href=\"#datafile\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h5>\n<p>Default: <code class=\"docutils literal notranslate\">None</code></p>\n<p>This is an Oracle-specific setting.</p>\n<p>The name of the datafile to use for the TBLSPACE. If not provided, Django will\nuse <code class=\"docutils literal notranslate\">TBLSPACE + '.dbf'</code>.</p>\n</section>\n<section id=\"datafile-tmp\">\n<span id=\"std-setting-DATAFILE_TMP\"></span><h5><code class=\"docutils literal notranslate\">DATAFILE_TMP</code><a class=\"heading-anchor\" href=\"#datafile-tmp\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h5>\n<p>Default: <code class=\"docutils literal notranslate\">None</code></p>\n<p>This is an Oracle-specific setting.</p>\n<p>The name of the datafile to use for the TBLSPACE_TMP. If not provided, Django\nwill use <code class=\"docutils literal notranslate\">TBLSPACE_TMP + '.dbf'</code>.</p>\n</section>\n<section id=\"datafile-maxsize\">\n<span id=\"std-setting-DATAFILE_MAXSIZE\"></span><h5><code class=\"docutils literal notranslate\">DATAFILE_MAXSIZE</code><a class=\"heading-anchor\" href=\"#datafile-maxsize\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h5>\n<p>Default: <code class=\"docutils literal notranslate\">'500M'</code></p>\n<p>This is an Oracle-specific setting.</p>\n<p>The maximum size that the DATAFILE is allowed to grow to.</p>\n</section>\n<section id=\"datafile-tmp-maxsize\">\n<span id=\"std-setting-DATAFILE_TMP_MAXSIZE\"></span><h5><code class=\"docutils literal notranslate\">DATAFILE_TMP_MAXSIZE</code><a class=\"heading-anchor\" href=\"#datafile-tmp-maxsize\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h5>\n<p>Default: <code class=\"docutils literal notranslate\">'500M'</code></p>\n<p>This is an Oracle-specific setting.</p>\n<p>The maximum size that the DATAFILE_TMP is allowed to grow to.</p>\n</section>\n<section id=\"datafile-size\">\n<span id=\"std-setting-DATAFILE_SIZE\"></span><h5><code class=\"docutils literal notranslate\">DATAFILE_SIZE</code><a class=\"heading-anchor\" href=\"#datafile-size\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h5>\n<p>Default: <code class=\"docutils literal notranslate\">'50M'</code></p>\n<p>This is an Oracle-specific setting.</p>\n<p>The initial size of the DATAFILE.</p>\n</section>\n<section id=\"datafile-tmp-size\">\n<span id=\"std-setting-DATAFILE_TMP_SIZE\"></span><h5><code class=\"docutils literal notranslate\">DATAFILE_TMP_SIZE</code><a class=\"heading-anchor\" href=\"#datafile-tmp-size\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h5>\n<p>Default: <code class=\"docutils literal notranslate\">'50M'</code></p>\n<p>This is an Oracle-specific setting.</p>\n<p>The initial size of the DATAFILE_TMP.</p>\n</section>\n<section id=\"datafile-extsize\">\n<span id=\"std-setting-DATAFILE_EXTSIZE\"></span><h5><code class=\"docutils literal notranslate\">DATAFILE_EXTSIZE</code><a class=\"heading-anchor\" href=\"#datafile-extsize\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h5>\n<p>Default: <code class=\"docutils literal notranslate\">'25M'</code></p>\n<p>This is an Oracle-specific setting.</p>\n<p>The amount by which the DATAFILE is extended when more space is required.</p>\n</section>\n<section id=\"datafile-tmp-extsize\">\n<span id=\"std-setting-DATAFILE_TMP_EXTSIZE\"></span><h5><code class=\"docutils literal notranslate\">DATAFILE_TMP_EXTSIZE</code><a class=\"heading-anchor\" href=\"#datafile-tmp-extsize\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h5>\n<p>Default: <code class=\"docutils literal notranslate\">'25M'</code></p>\n<p>This is an Oracle-specific setting.</p>\n<p>The amount by which the DATAFILE_TMP is extended when more space is required.</p>\n</section>\n</section>\n</section>\n<section id=\"data-upload-max-memory-size\">\n<span id=\"std-setting-DATA_UPLOAD_MAX_MEMORY_SIZE\"></span><h3><code class=\"docutils literal notranslate\">DATA_UPLOAD_MAX_MEMORY_SIZE</code><a class=\"heading-anchor\" href=\"#data-upload-max-memory-size\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h3>\n<p>Default: <code class=\"docutils literal notranslate\">2621440</code> (i.e. 2.5 MB).</p>\n<p>The maximum size in bytes that a request body may be before a\n<a class=\"reference internal\" href=\"/it/4.1/ref/exceptions/#django.core.exceptions.SuspiciousOperation\" title=\"django.core.exceptions.SuspiciousOperation\"><code class=\"xref py py-exc docutils literal notranslate\">SuspiciousOperation</code></a> (<code class=\"docutils literal notranslate\">RequestDataTooBig</code>) is\nraised. The check is done when accessing <code class=\"docutils literal notranslate\">request.body</code> or <code class=\"docutils literal notranslate\">request.POST</code>\nand is calculated against the total request size excluding any file upload\ndata. You can set this to <code class=\"docutils literal notranslate\">None</code> to disable the check. Applications that are\nexpected to receive unusually large form posts should tune this setting.</p>\n<p>The amount of request data is correlated to the amount of memory needed to\nprocess the request and populate the GET and POST dictionaries. Large requests\ncould be used as a denial-of-service attack vector if left unchecked. Since web\nservers don’t typically perform deep request inspection, it’s not possible to\nperform a similar check at that level.</p>\n<p>See also <a class=\"reference internal\" href=\"#std-setting-FILE_UPLOAD_MAX_MEMORY_SIZE\"><code class=\"xref std std-setting docutils literal notranslate\">FILE_UPLOAD_MAX_MEMORY_SIZE</code></a>.</p>\n</section>\n<section id=\"data-upload-max-number-fields\">\n<span id=\"std-setting-DATA_UPLOAD_MAX_NUMBER_FIELDS\"></span><h3><code class=\"docutils literal notranslate\">DATA_UPLOAD_MAX_NUMBER_FIELDS</code><a class=\"heading-anchor\" href=\"#data-upload-max-number-fields\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h3>\n<p>Default: <code class=\"docutils literal notranslate\">1000</code></p>\n<p>The maximum number of parameters that may be received via GET or POST before a\n<a class=\"reference internal\" href=\"/it/4.1/ref/exceptions/#django.core.exceptions.SuspiciousOperation\" title=\"django.core.exceptions.SuspiciousOperation\"><code class=\"xref py py-exc docutils literal notranslate\">SuspiciousOperation</code></a> (<code class=\"docutils literal notranslate\">TooManyFields</code>) is\nraised. You can set this to <code class=\"docutils literal notranslate\">None</code> to disable the check. Applications that\nare expected to receive an unusually large number of form fields should tune\nthis setting.</p>\n<p>The number of request parameters is correlated to the amount of time needed to\nprocess the request and populate the GET and POST dictionaries. Large requests\ncould be used as a denial-of-service attack vector if left unchecked. Since web\nservers don’t typically perform deep request inspection, it’s not possible to\nperform a similar check at that level.</p>\n</section>\n<section id=\"data-upload-max-number-files\">\n<span id=\"std-setting-DATA_UPLOAD_MAX_NUMBER_FILES\"></span><h3><code class=\"docutils literal notranslate\">DATA_UPLOAD_MAX_NUMBER_FILES</code><a class=\"heading-anchor\" href=\"#data-upload-max-number-files\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h3>\n<aside class=\"version-note version-added\" data-version=\"3.2.18\" role=\"note\">\n<p class=\"version-note-title\">New in Django 3.2.18</p></aside>\n<p>Default: <code class=\"docutils literal notranslate\">100</code></p>\n<p>The maximum number of files that may be received via POST in a\n<code class=\"docutils literal notranslate\">multipart/form-data</code> encoded request before a\n<a class=\"reference internal\" href=\"/it/4.1/ref/exceptions/#django.core.exceptions.SuspiciousOperation\" title=\"django.core.exceptions.SuspiciousOperation\"><code class=\"xref py py-exc docutils literal notranslate\">SuspiciousOperation</code></a> (<code class=\"docutils literal notranslate\">TooManyFiles</code>) is\nraised. You can set this to <code class=\"docutils literal notranslate\">None</code> to disable the check. Applications that\nare expected to receive an unusually large number of file fields should tune\nthis setting.</p>\n<p>The number of accepted files is correlated to the amount of time and memory\nneeded to process the request. Large requests could be used as a\ndenial-of-service attack vector if left unchecked. Since web servers don’t\ntypically perform deep request inspection, it’s not possible to perform a\nsimilar check at that level.</p>\n</section>\n<section id=\"database-routers\">\n<span id=\"std-setting-DATABASE_ROUTERS\"></span><h3><code class=\"docutils literal notranslate\">DATABASE_ROUTERS</code><a class=\"heading-anchor\" href=\"#database-routers\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h3>\n<p>Default: <code class=\"docutils literal notranslate\">[]</code> (Empty list)</p>\n<p>The list of routers that will be used to determine which database\nto use when performing a database query.</p>\n<p>See the documentation on <a class=\"reference internal\" href=\"/it/4.1/topics/db/multi-db/#topics-db-multi-db-routing\"><span class=\"std std-ref\">automatic database routing in multi\ndatabase configurations</span></a>.</p>\n</section>\n<section id=\"date-format\">\n<span id=\"std-setting-DATE_FORMAT\"></span><h3><code class=\"docutils literal notranslate\">DATE_FORMAT</code><a class=\"heading-anchor\" href=\"#date-format\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h3>\n<p>Default: <code class=\"docutils literal notranslate\">'N j, Y'</code> (e.g. <code class=\"docutils literal notranslate\">Feb. 4, 2003</code>)</p>\n<p>The default formatting to use for displaying date fields in any part of the\nsystem. Note that if <a class=\"reference internal\" href=\"#std-setting-USE_L10N\"><code class=\"xref std std-setting docutils literal notranslate\">USE_L10N</code></a> is set to <code class=\"docutils literal notranslate\">True</code>, then the\nlocale-dictated format has higher precedence and will be applied instead. See\n<a class=\"reference internal\" href=\"/it/4.1/ref/templates/builtins/#std-templatefilter-date\"><code class=\"xref std std-tfilter docutils literal notranslate\">allowed date format strings</code></a>.</p>\n<p>See also <a class=\"reference internal\" href=\"#std-setting-DATETIME_FORMAT\"><code class=\"xref std std-setting docutils literal notranslate\">DATETIME_FORMAT</code></a>, <a class=\"reference internal\" href=\"#std-setting-TIME_FORMAT\"><code class=\"xref std std-setting docutils literal notranslate\">TIME_FORMAT</code></a> and <a class=\"reference internal\" href=\"#std-setting-SHORT_DATE_FORMAT\"><code class=\"xref std std-setting docutils literal notranslate\">SHORT_DATE_FORMAT</code></a>.</p>\n</section>\n<section id=\"date-input-formats\">\n<span id=\"std-setting-DATE_INPUT_FORMATS\"></span><h3><code class=\"docutils literal notranslate\">DATE_INPUT_FORMATS</code><a class=\"heading-anchor\" href=\"#date-input-formats\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h3>\n<p>Default:</p>\n<div class=\"code-block\" data-language=\"default\"><div class=\"code-block-toolbar\"><span class=\"code-block-language\">Code</span><button type=\"button\" class=\"copy-button\" data-copy hidden><span class=\"copy-button-label\">Copy</span></button></div><pre role=\"group\" tabindex=\"0\" aria-label=\"Code code\"><code><span class=\"p\">[</span>\n    <span class=\"s1\">&#39;%Y-%m-</span><span class=\"si\">%d</span><span class=\"s1\">&#39;</span><span class=\"p\">,</span>  <span class=\"c1\"># &#39;2006-10-25&#39;</span>\n    <span class=\"s1\">&#39;%m/</span><span class=\"si\">%d</span><span class=\"s1\">/%Y&#39;</span><span class=\"p\">,</span>  <span class=\"c1\"># &#39;10/25/2006&#39;</span>\n    <span class=\"s1\">&#39;%m/</span><span class=\"si\">%d</span><span class=\"s1\">/%y&#39;</span><span class=\"p\">,</span>  <span class=\"c1\"># &#39;10/25/06&#39;</span>\n    <span class=\"s1\">&#39;%b </span><span class=\"si\">%d</span><span class=\"s1\"> %Y&#39;</span><span class=\"p\">,</span>  <span class=\"c1\"># &#39;Oct 25 2006&#39;</span>\n    <span class=\"s1\">&#39;%b </span><span class=\"si\">%d</span><span class=\"s1\">, %Y&#39;</span><span class=\"p\">,</span>  <span class=\"c1\"># &#39;Oct 25, 2006&#39;</span>\n    <span class=\"s1\">&#39;</span><span class=\"si\">%d</span><span class=\"s1\"> %b %Y&#39;</span><span class=\"p\">,</span>  <span class=\"c1\"># &#39;25 Oct 2006&#39;</span>\n    <span class=\"s1\">&#39;</span><span class=\"si\">%d</span><span class=\"s1\"> %b, %Y&#39;</span><span class=\"p\">,</span>  <span class=\"c1\"># &#39;25 Oct, 2006&#39;</span>\n    <span class=\"s1\">&#39;%B </span><span class=\"si\">%d</span><span class=\"s1\"> %Y&#39;</span><span class=\"p\">,</span>  <span class=\"c1\"># &#39;October 25 2006&#39;</span>\n    <span class=\"s1\">&#39;%B </span><span class=\"si\">%d</span><span class=\"s1\">, %Y&#39;</span><span class=\"p\">,</span>  <span class=\"c1\"># &#39;October 25, 2006&#39;</span>\n    <span class=\"s1\">&#39;</span><span class=\"si\">%d</span><span class=\"s1\"> %B %Y&#39;</span><span class=\"p\">,</span>  <span class=\"c1\"># &#39;25 October 2006&#39;</span>\n    <span class=\"s1\">&#39;</span><span class=\"si\">%d</span><span class=\"s1\"> %B, %Y&#39;</span><span class=\"p\">,</span>  <span class=\"c1\"># &#39;25 October, 2006&#39;</span>\n<span class=\"p\">]</span>\n</code></pre></div>\n<p>A list of formats that will be accepted when inputting data on a date field.\nFormats will be tried in order, using the first valid one. Note that these\nformat strings use Python’s <a class=\"reference external\" href=\"https://docs.python.org/3/library/datetime.html#strftime-strptime-behavior\" title=\"(in Python v3.14)\"><span class=\"xref std std-ref\">datetime module syntax</span></a>, not the format strings from the <a class=\"reference internal\" href=\"/it/4.1/ref/templates/builtins/#std-templatefilter-date\"><code class=\"xref std std-tfilter docutils literal notranslate\">date</code></a>\ntemplate filter.</p>\n<p>When <a class=\"reference internal\" href=\"#std-setting-USE_L10N\"><code class=\"xref std std-setting docutils literal notranslate\">USE_L10N</code></a> is <code class=\"docutils literal notranslate\">True</code>, the locale-dictated format has higher\nprecedence and will be applied instead.</p>\n<p>See also <a class=\"reference internal\" href=\"#std-setting-DATETIME_INPUT_FORMATS\"><code class=\"xref std std-setting docutils literal notranslate\">DATETIME_INPUT_FORMATS</code></a> and <a class=\"reference internal\" href=\"#std-setting-TIME_INPUT_FORMATS\"><code class=\"xref std std-setting docutils literal notranslate\">TIME_INPUT_FORMATS</code></a>.</p>\n</section>\n<section id=\"datetime-format\">\n<span id=\"std-setting-DATETIME_FORMAT\"></span><h3><code class=\"docutils literal notranslate\">DATETIME_FORMAT</code><a class=\"heading-anchor\" href=\"#datetime-format\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h3>\n<p>Default: <code class=\"docutils literal notranslate\">'N j, Y, P'</code> (e.g. <code class=\"docutils literal notranslate\">Feb. 4, 2003, 4 p.m.</code>)</p>\n<p>The default formatting to use for displaying datetime fields in any part of the\nsystem. Note that if <a class=\"reference internal\" href=\"#std-setting-USE_L10N\"><code class=\"xref std std-setting docutils literal notranslate\">USE_L10N</code></a> is set to <code class=\"docutils literal notranslate\">True</code>, then the\nlocale-dictated format has higher precedence and will be applied instead. See\n<a class=\"reference internal\" href=\"/it/4.1/ref/templates/builtins/#std-templatefilter-date\"><code class=\"xref std std-tfilter docutils literal notranslate\">allowed date format strings</code></a>.</p>\n<p>See also <a class=\"reference internal\" href=\"#std-setting-DATE_FORMAT\"><code class=\"xref std std-setting docutils literal notranslate\">DATE_FORMAT</code></a>, <a class=\"reference internal\" href=\"#std-setting-TIME_FORMAT\"><code class=\"xref std std-setting docutils literal notranslate\">TIME_FORMAT</code></a> and <a class=\"reference internal\" href=\"#std-setting-SHORT_DATETIME_FORMAT\"><code class=\"xref std std-setting docutils literal notranslate\">SHORT_DATETIME_FORMAT</code></a>.</p>\n</section>\n<section id=\"datetime-input-formats\">\n<span id=\"std-setting-DATETIME_INPUT_FORMATS\"></span><h3><code class=\"docutils literal notranslate\">DATETIME_INPUT_FORMATS</code><a class=\"heading-anchor\" href=\"#datetime-input-formats\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h3>\n<p>Default:</p>\n<div class=\"code-block\" data-language=\"default\"><div class=\"code-block-toolbar\"><span class=\"code-block-language\">Code</span><button type=\"button\" class=\"copy-button\" data-copy hidden><span class=\"copy-button-label\">Copy</span></button></div><pre role=\"group\" tabindex=\"0\" aria-label=\"Code code\"><code><span class=\"p\">[</span>\n    <span class=\"s1\">&#39;%Y-%m-</span><span class=\"si\">%d</span><span class=\"s1\"> %H:%M:%S&#39;</span><span class=\"p\">,</span>     <span class=\"c1\"># &#39;2006-10-25 14:30:59&#39;</span>\n    <span class=\"s1\">&#39;%Y-%m-</span><span class=\"si\">%d</span><span class=\"s1\"> %H:%M:%S.</span><span class=\"si\">%f</span><span class=\"s1\">&#39;</span><span class=\"p\">,</span>  <span class=\"c1\"># &#39;2006-10-25 14:30:59.000200&#39;</span>\n    <span class=\"s1\">&#39;%Y-%m-</span><span class=\"si\">%d</span><span class=\"s1\"> %H:%M&#39;</span><span class=\"p\">,</span>        <span class=\"c1\"># &#39;2006-10-25 14:30&#39;</span>\n    <span class=\"s1\">&#39;%m/</span><span class=\"si\">%d</span><span class=\"s1\">/%Y %H:%M:%S&#39;</span><span class=\"p\">,</span>     <span class=\"c1\"># &#39;10/25/2006 14:30:59&#39;</span>\n    <span class=\"s1\">&#39;%m/</span><span class=\"si\">%d</span><span class=\"s1\">/%Y %H:%M:%S.</span><span class=\"si\">%f</span><span class=\"s1\">&#39;</span><span class=\"p\">,</span>  <span class=\"c1\"># &#39;10/25/2006 14:30:59.000200&#39;</span>\n    <span class=\"s1\">&#39;%m/</span><span class=\"si\">%d</span><span class=\"s1\">/%Y %H:%M&#39;</span><span class=\"p\">,</span>        <span class=\"c1\"># &#39;10/25/2006 14:30&#39;</span>\n    <span class=\"s1\">&#39;%m/</span><span class=\"si\">%d</span><span class=\"s1\">/%y %H:%M:%S&#39;</span><span class=\"p\">,</span>     <span class=\"c1\"># &#39;10/25/06 14:30:59&#39;</span>\n    <span class=\"s1\">&#39;%m/</span><span class=\"si\">%d</span><span class=\"s1\">/%y %H:%M:%S.</span><span class=\"si\">%f</span><span class=\"s1\">&#39;</span><span class=\"p\">,</span>  <span class=\"c1\"># &#39;10/25/06 14:30:59.000200&#39;</span>\n    <span class=\"s1\">&#39;%m/</span><span class=\"si\">%d</span><span class=\"s1\">/%y %H:%M&#39;</span><span class=\"p\">,</span>        <span class=\"c1\"># &#39;10/25/06 14:30&#39;</span>\n<span class=\"p\">]</span>\n</code></pre></div>\n<p>A list of formats that will be accepted when inputting data on a datetime\nfield. Formats will be tried in order, using the first valid one. Note that\nthese format strings use Python’s <a class=\"reference external\" href=\"https://docs.python.org/3/library/datetime.html#strftime-strptime-behavior\" title=\"(in Python v3.14)\"><span class=\"xref std std-ref\">datetime module syntax</span></a>, not the format strings from the <a class=\"reference internal\" href=\"/it/4.1/ref/templates/builtins/#std-templatefilter-date\"><code class=\"xref std std-tfilter docutils literal notranslate\">date</code></a>\ntemplate filter. Date-only formats are not included as datetime fields will\nautomatically try <a class=\"reference internal\" href=\"#std-setting-DATE_INPUT_FORMATS\"><code class=\"xref std std-setting docutils literal notranslate\">DATE_INPUT_FORMATS</code></a> in last resort.</p>\n<p>When <a class=\"reference internal\" href=\"#std-setting-USE_L10N\"><code class=\"xref std std-setting docutils literal notranslate\">USE_L10N</code></a> is <code class=\"docutils literal notranslate\">True</code>, the locale-dictated format has higher\nprecedence and will be applied instead.</p>\n<p>See also <a class=\"reference internal\" href=\"#std-setting-DATE_INPUT_FORMATS\"><code class=\"xref std std-setting docutils literal notranslate\">DATE_INPUT_FORMATS</code></a> and <a class=\"reference internal\" href=\"#std-setting-TIME_INPUT_FORMATS\"><code class=\"xref std std-setting docutils literal notranslate\">TIME_INPUT_FORMATS</code></a>.</p>\n</section>\n<section id=\"debug\">\n<span id=\"std-setting-DEBUG\"></span><h3><code class=\"docutils literal notranslate\">DEBUG</code><a class=\"heading-anchor\" href=\"#debug\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h3>\n<p>Default: <code class=\"docutils literal notranslate\">False</code></p>\n<p>A boolean that turns on/off debug mode.</p>\n<p>Never deploy a site into production with <a class=\"reference internal\" href=\"#std-setting-DEBUG\"><code class=\"xref std std-setting docutils literal notranslate\">DEBUG</code></a> turned on.</p>\n<p>One of the main features of debug mode is the display of detailed error pages.\nIf your app raises an exception when <a class=\"reference internal\" href=\"#std-setting-DEBUG\"><code class=\"xref std std-setting docutils literal notranslate\">DEBUG</code></a> is <code class=\"docutils literal notranslate\">True</code>, Django will\ndisplay a detailed traceback, including a lot of metadata about your\nenvironment, such as all the currently defined Django settings (from\n<code class=\"docutils literal notranslate\">settings.py</code>).</p>\n<p>As a security measure, Django will <em>not</em> include settings that might be\nsensitive, such as <a class=\"reference internal\" href=\"#std-setting-SECRET_KEY\"><code class=\"xref std std-setting docutils literal notranslate\">SECRET_KEY</code></a>. Specifically, it will exclude any\nsetting whose name includes any of the following:</p>\n<ul class=\"simple\">\n<li><p><code class=\"docutils literal notranslate\">'API'</code></p></li>\n<li><p><code class=\"docutils literal notranslate\">'KEY'</code></p></li>\n<li><p><code class=\"docutils literal notranslate\">'PASS'</code></p></li>\n<li><p><code class=\"docutils literal notranslate\">'SECRET'</code></p></li>\n<li><p><code class=\"docutils literal notranslate\">'SIGNATURE'</code></p></li>\n<li><p><code class=\"docutils literal notranslate\">'TOKEN'</code></p></li>\n</ul>\n<p>Note that these are <em>partial</em> matches. <code class=\"docutils literal notranslate\">'PASS'</code> will also match PASSWORD,\njust as <code class=\"docutils literal notranslate\">'TOKEN'</code> will also match TOKENIZED and so on.</p>\n<p>Still, note that there are always going to be sections of your debug output\nthat are inappropriate for public consumption. File paths, configuration\noptions and the like all give attackers extra information about your server.</p>\n<p>It is also important to remember that when running with <a class=\"reference internal\" href=\"#std-setting-DEBUG\"><code class=\"xref std std-setting docutils literal notranslate\">DEBUG</code></a>\nturned on, Django will remember every SQL query it executes. This is useful\nwhen you’re debugging, but it’ll rapidly consume memory on a production server.</p>\n<p>Finally, if <a class=\"reference internal\" href=\"#std-setting-DEBUG\"><code class=\"xref std std-setting docutils literal notranslate\">DEBUG</code></a> is <code class=\"docutils literal notranslate\">False</code>, you also need to properly set\nthe <a class=\"reference internal\" href=\"#std-setting-ALLOWED_HOSTS\"><code class=\"xref std std-setting docutils literal notranslate\">ALLOWED_HOSTS</code></a> setting. Failing to do so will result in all\nrequests being returned as «Bad Request (400)».</p>\n<aside class=\"admonition admonition-note\" role=\"note\">\n<p class=\"admonition-title\">Nota</p>\n<p>The default <code class=\"file docutils literal notranslate\">settings.py</code> file created by <a class=\"reference internal\" href=\"/it/4.1/ref/django-admin/#django-admin-startproject\"><code class=\"xref std std-djadmin docutils literal notranslate\">django-admin\nstartproject</code></a> sets <code class=\"docutils literal notranslate\">DEBUG = True</code> for convenience.</p>\n</aside>\n</section>\n<section id=\"debug-propagate-exceptions\">\n<span id=\"std-setting-DEBUG_PROPAGATE_EXCEPTIONS\"></span><h3><code class=\"docutils literal notranslate\">DEBUG_PROPAGATE_EXCEPTIONS</code><a class=\"heading-anchor\" href=\"#debug-propagate-exceptions\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h3>\n<p>Default: <code class=\"docutils literal notranslate\">False</code></p>\n<p>If set to <code class=\"docutils literal notranslate\">True</code>, Django’s exception handling of view functions\n(<a class=\"reference internal\" href=\"/it/4.1/ref/urls/#django.conf.urls.handler500\" title=\"django.conf.urls.handler500\"><code class=\"xref py py-data docutils literal notranslate\">handler500</code></a>, or the debug view if <a class=\"reference internal\" href=\"#std-setting-DEBUG\"><code class=\"xref std std-setting docutils literal notranslate\">DEBUG</code></a>\nis <code class=\"docutils literal notranslate\">True</code>) and logging of 500 responses (<a class=\"reference internal\" href=\"/it/4.1/ref/logging/#django-request-logger\"><span class=\"std std-ref\">django.request</span></a>) is\nskipped and exceptions propagate upward.</p>\n<p>This can be useful for some test setups. It shouldn’t be used on a live site\nunless you want your web server (instead of Django) to generate «Internal\nServer Error» responses. In that case, make sure your server doesn’t show the\nstack trace or other sensitive information in the response.</p>\n</section>\n<section id=\"decimal-separator\">\n<span id=\"std-setting-DECIMAL_SEPARATOR\"></span><h3><code class=\"docutils literal notranslate\">DECIMAL_SEPARATOR</code><a class=\"heading-anchor\" href=\"#decimal-separator\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h3>\n<p>Default: <code class=\"docutils literal notranslate\">'.'</code> (Dot)</p>\n<p>Default decimal separator used when formatting decimal numbers.</p>\n<p>Note that if <a class=\"reference internal\" href=\"#std-setting-USE_L10N\"><code class=\"xref std std-setting docutils literal notranslate\">USE_L10N</code></a> is set to <code class=\"docutils literal notranslate\">True</code>, then the locale-dictated\nformat has higher precedence and will be applied instead.</p>\n<p>See also <a class=\"reference internal\" href=\"#std-setting-NUMBER_GROUPING\"><code class=\"xref std std-setting docutils literal notranslate\">NUMBER_GROUPING</code></a>, <a class=\"reference internal\" href=\"#std-setting-THOUSAND_SEPARATOR\"><code class=\"xref std std-setting docutils literal notranslate\">THOUSAND_SEPARATOR</code></a> and\n<a class=\"reference internal\" href=\"#std-setting-USE_THOUSAND_SEPARATOR\"><code class=\"xref std std-setting docutils literal notranslate\">USE_THOUSAND_SEPARATOR</code></a>.</p>\n</section>\n<section id=\"default-auto-field\">\n<span id=\"std-setting-DEFAULT_AUTO_FIELD\"></span><h3><code class=\"docutils literal notranslate\">DEFAULT_AUTO_FIELD</code><a class=\"heading-anchor\" href=\"#default-auto-field\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h3>\n<p>Default: <code class=\"docutils literal notranslate\">'</code><a class=\"reference internal\" href=\"/it/4.1/ref/models/fields/#django.db.models.AutoField\" title=\"django.db.models.AutoField\"><code class=\"xref py py-class docutils literal notranslate\">django.db.models.AutoField</code></a><code class=\"docutils literal notranslate\">'</code></p>\n<p>Default primary key field type to use for models that don’t have a field with\n<a class=\"reference internal\" href=\"/it/4.1/ref/models/fields/#django.db.models.Field.primary_key\" title=\"django.db.models.Field.primary_key\"><code class=\"xref py py-attr docutils literal notranslate\">primary_key=True</code></a>.</p>\n<aside class=\"admonition-migrating-auto-created-through-tables admonition\" role=\"note\">\n<p class=\"admonition-title\">Migrating auto-created through tables</p>\n<p>The value of <code class=\"docutils literal notranslate\">DEFAULT_AUTO_FIELD</code> will be respected when creating new\nauto-created through tables for many-to-many relationships.</p>\n<p>Unfortunately, the primary keys of existing auto-created through tables\ncannot currently be updated by the migrations framework.</p>\n<p>This means that if you switch the value of <code class=\"docutils literal notranslate\">DEFAULT_AUTO_FIELD</code> and then\ngenerate migrations, the primary keys of the related models will be\nupdated, as will the foreign keys from the through table, but the primary\nkey of the auto-created through table will not be migrated.</p>\n<p>In order to address this, you should add a\n<a class=\"reference internal\" href=\"/it/4.1/ref/migration-operations/#django.db.migrations.operations.RunSQL\" title=\"django.db.migrations.operations.RunSQL\"><code class=\"xref py py-class docutils literal notranslate\">RunSQL</code></a> operation to your\nmigrations to perform the required <code class=\"docutils literal notranslate\">ALTER TABLE</code> step. You can check the\nexisting table name through <code class=\"docutils literal notranslate\">sqlmigrate</code>, <code class=\"docutils literal notranslate\">dbshell</code>, or with the\nfield’s <code class=\"docutils literal notranslate\">remote_field.through._meta.db_table</code> property.</p>\n<p>Explicitly defined through models are already handled by the migrations\nsystem.</p>\n<p>Allowing automatic migrations for the primary key of existing auto-created\nthrough tables <a class=\"extlink-ticket reference external\" href=\"https://code.djangoproject.com/ticket/32674\">may be implemented at a later date</a>.</p>\n</aside>\n</section>\n<section id=\"default-charset\">\n<span id=\"std-setting-DEFAULT_CHARSET\"></span><h3><code class=\"docutils literal notranslate\">DEFAULT_CHARSET</code><a class=\"heading-anchor\" href=\"#default-charset\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h3>\n<p>Default: <code class=\"docutils literal notranslate\">'utf-8'</code></p>\n<p>Default charset to use for all <code class=\"docutils literal notranslate\">HttpResponse</code> objects, if a MIME type isn’t\nmanually specified. Used when constructing the <code class=\"docutils literal notranslate\">Content-Type</code> header.</p>\n</section>\n<section id=\"default-exception-reporter\">\n<span id=\"std-setting-DEFAULT_EXCEPTION_REPORTER\"></span><h3><code class=\"docutils literal notranslate\">DEFAULT_EXCEPTION_REPORTER</code><a class=\"heading-anchor\" href=\"#default-exception-reporter\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h3>\n<p>Default: <code class=\"docutils literal notranslate\">'</code><a class=\"reference internal\" href=\"/it/4.1/howto/error-reporting/#django.views.debug.ExceptionReporter\" title=\"django.views.debug.ExceptionReporter\"><code class=\"xref py py-class docutils literal notranslate\">django.views.debug.ExceptionReporter</code></a><code class=\"docutils literal notranslate\">'</code></p>\n<p>Default exception reporter class to be used if none has been assigned to the\n<a class=\"reference internal\" href=\"/it/4.1/ref/request-response/#django.http.HttpRequest\" title=\"django.http.HttpRequest\"><code class=\"xref py py-class docutils literal notranslate\">HttpRequest</code></a> instance yet. See\n<a class=\"reference internal\" href=\"/it/4.1/howto/error-reporting/#custom-error-reports\"><span class=\"std std-ref\">Rapporti di errore personalizzati</span></a>.</p>\n</section>\n<section id=\"default-exception-reporter-filter\">\n<span id=\"std-setting-DEFAULT_EXCEPTION_REPORTER_FILTER\"></span><h3><code class=\"docutils literal notranslate\">DEFAULT_EXCEPTION_REPORTER_FILTER</code><a class=\"heading-anchor\" href=\"#default-exception-reporter-filter\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h3>\n<p>Default: <code class=\"docutils literal notranslate\">'</code><a class=\"reference internal\" href=\"/it/4.1/howto/error-reporting/#django.views.debug.SafeExceptionReporterFilter\" title=\"django.views.debug.SafeExceptionReporterFilter\"><code class=\"xref py py-class docutils literal notranslate\">django.views.debug.SafeExceptionReporterFilter</code></a><code class=\"docutils literal notranslate\">'</code></p>\n<p>Default exception reporter filter class to be used if none has been assigned to\nthe <a class=\"reference internal\" href=\"/it/4.1/ref/request-response/#django.http.HttpRequest\" title=\"django.http.HttpRequest\"><code class=\"xref py py-class docutils literal notranslate\">HttpRequest</code></a> instance yet.\nSee <a class=\"reference internal\" href=\"/it/4.1/howto/error-reporting/#filtering-error-reports\"><span class=\"std std-ref\">Filtering error reports</span></a>.</p>\n</section>\n<section id=\"default-file-storage\">\n<span id=\"std-setting-DEFAULT_FILE_STORAGE\"></span><h3><code class=\"docutils literal notranslate\">DEFAULT_FILE_STORAGE</code><a class=\"heading-anchor\" href=\"#default-file-storage\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h3>\n<p>Default: <code class=\"docutils literal notranslate\">'</code><a class=\"reference internal\" href=\"/it/4.1/ref/files/storage/#django.core.files.storage.FileSystemStorage\" title=\"django.core.files.storage.FileSystemStorage\"><code class=\"xref py py-class docutils literal notranslate\">django.core.files.storage.FileSystemStorage</code></a><code class=\"docutils literal notranslate\">'</code></p>\n<p>Default file storage class to be used for any file-related operations that don’t\nspecify a particular storage system. See <a class=\"reference internal\" href=\"/it/4.1/topics/files/\"><span class=\"doc\">Managing files</span></a>.</p>\n</section>\n<section id=\"default-from-email\">\n<span id=\"std-setting-DEFAULT_FROM_EMAIL\"></span><h3><code class=\"docutils literal notranslate\">DEFAULT_FROM_EMAIL</code><a class=\"heading-anchor\" href=\"#default-from-email\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h3>\n<p>Default: <code class=\"docutils literal notranslate\">'webmaster&#64;localhost'</code></p>\n<p>Default email address to use for various automated correspondence from the\nsite manager(s). This doesn’t include error messages sent to <a class=\"reference internal\" href=\"#std-setting-ADMINS\"><code class=\"xref std std-setting docutils literal notranslate\">ADMINS</code></a>\nand <a class=\"reference internal\" href=\"#std-setting-MANAGERS\"><code class=\"xref std std-setting docutils literal notranslate\">MANAGERS</code></a>; for that, see <a class=\"reference internal\" href=\"#std-setting-SERVER_EMAIL\"><code class=\"xref std std-setting docutils literal notranslate\">SERVER_EMAIL</code></a>.</p>\n</section>\n<section id=\"default-index-tablespace\">\n<span id=\"std-setting-DEFAULT_INDEX_TABLESPACE\"></span><h3><code class=\"docutils literal notranslate\">DEFAULT_INDEX_TABLESPACE</code><a class=\"heading-anchor\" href=\"#default-index-tablespace\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h3>\n<p>Default: <code class=\"docutils literal notranslate\">''</code> (Empty string)</p>\n<p>Default tablespace to use for indexes on fields that don’t specify\none, if the backend supports it (see <a class=\"reference internal\" href=\"/it/4.1/topics/db/tablespaces/\"><span class=\"doc\">Tablespaces</span></a>).</p>\n</section>\n<section id=\"default-tablespace\">\n<span id=\"std-setting-DEFAULT_TABLESPACE\"></span><h3><code class=\"docutils literal notranslate\">DEFAULT_TABLESPACE</code><a class=\"heading-anchor\" href=\"#default-tablespace\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h3>\n<p>Default: <code class=\"docutils literal notranslate\">''</code> (Empty string)</p>\n<p>Default tablespace to use for models that don’t specify one, if the\nbackend supports it (see <a class=\"reference internal\" href=\"/it/4.1/topics/db/tablespaces/\"><span class=\"doc\">Tablespaces</span></a>).</p>\n</section>\n<section id=\"disallowed-user-agents\">\n<span id=\"std-setting-DISALLOWED_USER_AGENTS\"></span><h3><code class=\"docutils literal notranslate\">DISALLOWED_USER_AGENTS</code><a class=\"heading-anchor\" href=\"#disallowed-user-agents\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h3>\n<p>Default: <code class=\"docutils literal notranslate\">[]</code> (Empty list)</p>\n<p>List of compiled regular expression objects representing User-Agent strings\nthat are not allowed to visit any page, systemwide. Use this for bots/crawlers.\nThis is only used if <code class=\"docutils literal notranslate\">CommonMiddleware</code> is installed (see\n<a class=\"reference internal\" href=\"/it/4.1/topics/http/middleware/\"><span class=\"doc\">Middleware</span></a>).</p>\n</section>\n<section id=\"email-backend\">\n<span id=\"std-setting-EMAIL_BACKEND\"></span><h3><code class=\"docutils literal notranslate\">EMAIL_BACKEND</code><a class=\"heading-anchor\" href=\"#email-backend\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h3>\n<p>Default: <code class=\"docutils literal notranslate\">'</code><a class=\"reference internal\" href=\"/it/4.1/topics/email/#django.core.mail.backends.smtp.EmailBackend\" title=\"django.core.mail.backends.smtp.EmailBackend\"><code class=\"xref py py-class docutils literal notranslate\">django.core.mail.backends.smtp.EmailBackend</code></a><code class=\"docutils literal notranslate\">'</code></p>\n<p>The backend to use for sending emails. For the list of available backends see\n<a class=\"reference internal\" href=\"/it/4.1/topics/email/\"><span class=\"doc\">Sending email</span></a>.</p>\n</section>\n<section id=\"email-file-path\">\n<span id=\"std-setting-EMAIL_FILE_PATH\"></span><h3><code class=\"docutils literal notranslate\">EMAIL_FILE_PATH</code><a class=\"heading-anchor\" href=\"#email-file-path\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h3>\n<p>Default: Not defined</p>\n<p>The directory used by the <a class=\"reference internal\" href=\"/it/4.1/topics/email/#topic-email-file-backend\"><span class=\"std std-ref\">file email backend</span></a>\nto store output files.</p>\n</section>\n<section id=\"email-host\">\n<span id=\"std-setting-EMAIL_HOST\"></span><h3><code class=\"docutils literal notranslate\">EMAIL_HOST</code><a class=\"heading-anchor\" href=\"#email-host\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h3>\n<p>Default: <code class=\"docutils literal notranslate\">'localhost'</code></p>\n<p>The host to use for sending email.</p>\n<p>See also <a class=\"reference internal\" href=\"#std-setting-EMAIL_PORT\"><code class=\"xref std std-setting docutils literal notranslate\">EMAIL_PORT</code></a>.</p>\n</section>\n<section id=\"email-host-password\">\n<span id=\"std-setting-EMAIL_HOST_PASSWORD\"></span><h3><code class=\"docutils literal notranslate\">EMAIL_HOST_PASSWORD</code><a class=\"heading-anchor\" href=\"#email-host-password\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h3>\n<p>Default: <code class=\"docutils literal notranslate\">''</code> (Empty string)</p>\n<p>Password to use for the SMTP server defined in <a class=\"reference internal\" href=\"#std-setting-EMAIL_HOST\"><code class=\"xref std std-setting docutils literal notranslate\">EMAIL_HOST</code></a>. This\nsetting is used in conjunction with <a class=\"reference internal\" href=\"#std-setting-EMAIL_HOST_USER\"><code class=\"xref std std-setting docutils literal notranslate\">EMAIL_HOST_USER</code></a> when\nauthenticating to the SMTP server. If either of these settings is empty,\nDjango won’t attempt authentication.</p>\n<p>See also <a class=\"reference internal\" href=\"#std-setting-EMAIL_HOST_USER\"><code class=\"xref std std-setting docutils literal notranslate\">EMAIL_HOST_USER</code></a>.</p>\n</section>\n<section id=\"email-host-user\">\n<span id=\"std-setting-EMAIL_HOST_USER\"></span><h3><code class=\"docutils literal notranslate\">EMAIL_HOST_USER</code><a class=\"heading-anchor\" href=\"#email-host-user\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h3>\n<p>Default: <code class=\"docutils literal notranslate\">''</code> (Empty string)</p>\n<p>Username to use for the SMTP server defined in <a class=\"reference internal\" href=\"#std-setting-EMAIL_HOST\"><code class=\"xref std std-setting docutils literal notranslate\">EMAIL_HOST</code></a>.\nIf empty, Django won’t attempt authentication.</p>\n<p>See also <a class=\"reference internal\" href=\"#std-setting-EMAIL_HOST_PASSWORD\"><code class=\"xref std std-setting docutils literal notranslate\">EMAIL_HOST_PASSWORD</code></a>.</p>\n</section>\n<section id=\"email-port\">\n<span id=\"std-setting-EMAIL_PORT\"></span><h3><code class=\"docutils literal notranslate\">EMAIL_PORT</code><a class=\"heading-anchor\" href=\"#email-port\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h3>\n<p>Default: <code class=\"docutils literal notranslate\">25</code></p>\n<p>Port to use for the SMTP server defined in <a class=\"reference internal\" href=\"#std-setting-EMAIL_HOST\"><code class=\"xref std std-setting docutils literal notranslate\">EMAIL_HOST</code></a>.</p>\n</section>\n<section id=\"email-subject-prefix\">\n<span id=\"std-setting-EMAIL_SUBJECT_PREFIX\"></span><h3><code class=\"docutils literal notranslate\">EMAIL_SUBJECT_PREFIX</code><a class=\"heading-anchor\" href=\"#email-subject-prefix\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h3>\n<p>Default: <code class=\"docutils literal notranslate\">'[Django] '</code></p>\n<p>Subject-line prefix for email messages sent with <code class=\"docutils literal notranslate\">django.core.mail.mail_admins</code>\nor <code class=\"docutils literal notranslate\">django.core.mail.mail_managers</code>. You’ll probably want to include the\ntrailing space.</p>\n</section>\n<section id=\"email-use-localtime\">\n<span id=\"std-setting-EMAIL_USE_LOCALTIME\"></span><h3><code class=\"docutils literal notranslate\">EMAIL_USE_LOCALTIME</code><a class=\"heading-anchor\" href=\"#email-use-localtime\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h3>\n<p>Default: <code class=\"docutils literal notranslate\">False</code></p>\n<p>Whether to send the SMTP <code class=\"docutils literal notranslate\">Date</code> header of email messages in the local time\nzone (<code class=\"docutils literal notranslate\">True</code>) or in UTC (<code class=\"docutils literal notranslate\">False</code>).</p>\n</section>\n<section id=\"email-use-tls\">\n<span id=\"std-setting-EMAIL_USE_TLS\"></span><h3><code class=\"docutils literal notranslate\">EMAIL_USE_TLS</code><a class=\"heading-anchor\" href=\"#email-use-tls\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h3>\n<p>Default: <code class=\"docutils literal notranslate\">False</code></p>\n<p>Whether to use a TLS (secure) connection when talking to the SMTP server.\nThis is used for explicit TLS connections, generally on port 587. If you are\nexperiencing hanging connections, see the implicit TLS setting\n<a class=\"reference internal\" href=\"#std-setting-EMAIL_USE_SSL\"><code class=\"xref std std-setting docutils literal notranslate\">EMAIL_USE_SSL</code></a>.</p>\n</section>\n<section id=\"email-use-ssl\">\n<span id=\"std-setting-EMAIL_USE_SSL\"></span><h3><code class=\"docutils literal notranslate\">EMAIL_USE_SSL</code><a class=\"heading-anchor\" href=\"#email-use-ssl\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h3>\n<p>Default: <code class=\"docutils literal notranslate\">False</code></p>\n<p>Whether to use an implicit TLS (secure) connection when talking to the SMTP\nserver. In most email documentation this type of TLS connection is referred\nto as SSL. It is generally used on port 465. If you are experiencing problems,\nsee the explicit TLS setting <a class=\"reference internal\" href=\"#std-setting-EMAIL_USE_TLS\"><code class=\"xref std std-setting docutils literal notranslate\">EMAIL_USE_TLS</code></a>.</p>\n<p>Note that <a class=\"reference internal\" href=\"#std-setting-EMAIL_USE_TLS\"><code class=\"xref std std-setting docutils literal notranslate\">EMAIL_USE_TLS</code></a>/<a class=\"reference internal\" href=\"#std-setting-EMAIL_USE_SSL\"><code class=\"xref std std-setting docutils literal notranslate\">EMAIL_USE_SSL</code></a> are mutually\nexclusive, so only set one of those settings to <code class=\"docutils literal notranslate\">True</code>.</p>\n</section>\n<section id=\"email-ssl-certfile\">\n<span id=\"std-setting-EMAIL_SSL_CERTFILE\"></span><h3><code class=\"docutils literal notranslate\">EMAIL_SSL_CERTFILE</code><a class=\"heading-anchor\" href=\"#email-ssl-certfile\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h3>\n<p>Default: <code class=\"docutils literal notranslate\">None</code></p>\n<p>If <a class=\"reference internal\" href=\"#std-setting-EMAIL_USE_SSL\"><code class=\"xref std std-setting docutils literal notranslate\">EMAIL_USE_SSL</code></a> or <a class=\"reference internal\" href=\"#std-setting-EMAIL_USE_TLS\"><code class=\"xref std std-setting docutils literal notranslate\">EMAIL_USE_TLS</code></a> is <code class=\"docutils literal notranslate\">True</code>, you can\noptionally specify the path to a PEM-formatted certificate chain file to use\nfor the SSL connection.</p>\n</section>\n<section id=\"email-ssl-keyfile\">\n<span id=\"std-setting-EMAIL_SSL_KEYFILE\"></span><h3><code class=\"docutils literal notranslate\">EMAIL_SSL_KEYFILE</code><a class=\"heading-anchor\" href=\"#email-ssl-keyfile\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h3>\n<p>Default: <code class=\"docutils literal notranslate\">None</code></p>\n<p>If <a class=\"reference internal\" href=\"#std-setting-EMAIL_USE_SSL\"><code class=\"xref std std-setting docutils literal notranslate\">EMAIL_USE_SSL</code></a> or <a class=\"reference internal\" href=\"#std-setting-EMAIL_USE_TLS\"><code class=\"xref std std-setting docutils literal notranslate\">EMAIL_USE_TLS</code></a> is <code class=\"docutils literal notranslate\">True</code>, you can\noptionally specify the path to a PEM-formatted private key file to use for the\nSSL connection.</p>\n<p>Note that setting <a class=\"reference internal\" href=\"#std-setting-EMAIL_SSL_CERTFILE\"><code class=\"xref std std-setting docutils literal notranslate\">EMAIL_SSL_CERTFILE</code></a> and <a class=\"reference internal\" href=\"#std-setting-EMAIL_SSL_KEYFILE\"><code class=\"xref std std-setting docutils literal notranslate\">EMAIL_SSL_KEYFILE</code></a>\ndoesn’t result in any certificate checking. They’re passed to the underlying SSL\nconnection. Please refer to the documentation of Python’s\n<a class=\"reference external\" href=\"https://docs.python.org/3/library/ssl.html#ssl.SSLContext.wrap_socket\" title=\"(in Python v3.14)\"><code class=\"docutils literal notranslate\">ssl.SSLContext.wrap_socket()</code></a> function for details on how the\ncertificate chain file and private key file are handled.</p>\n</section>\n<section id=\"email-timeout\">\n<span id=\"std-setting-EMAIL_TIMEOUT\"></span><h3><code class=\"docutils literal notranslate\">EMAIL_TIMEOUT</code><a class=\"heading-anchor\" href=\"#email-timeout\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h3>\n<p>Default: <code class=\"docutils literal notranslate\">None</code></p>\n<p>Specifies a timeout in seconds for blocking operations like the connection\nattempt.</p>\n</section>\n<section id=\"file-upload-handlers\">\n<span id=\"std-setting-FILE_UPLOAD_HANDLERS\"></span><h3><code class=\"docutils literal notranslate\">FILE_UPLOAD_HANDLERS</code><a class=\"heading-anchor\" href=\"#file-upload-handlers\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h3>\n<p>Default:</p>\n<div class=\"code-block\" data-language=\"default\"><div class=\"code-block-toolbar\"><span class=\"code-block-language\">Code</span><button type=\"button\" class=\"copy-button\" data-copy hidden><span class=\"copy-button-label\">Copy</span></button></div><pre role=\"group\" tabindex=\"0\" aria-label=\"Code code\"><code><span class=\"p\">[</span>\n    <span class=\"s1\">&#39;django.core.files.uploadhandler.MemoryFileUploadHandler&#39;</span><span class=\"p\">,</span>\n    <span class=\"s1\">&#39;django.core.files.uploadhandler.TemporaryFileUploadHandler&#39;</span><span class=\"p\">,</span>\n<span class=\"p\">]</span>\n</code></pre></div>\n<p>A list of handlers to use for uploading. Changing this setting allows complete\ncustomization – even replacement – of Django’s upload process.</p>\n<p>See <a class=\"reference internal\" href=\"/it/4.1/topics/files/\"><span class=\"doc\">Managing files</span></a> for details.</p>\n</section>\n<section id=\"file-upload-max-memory-size\">\n<span id=\"std-setting-FILE_UPLOAD_MAX_MEMORY_SIZE\"></span><h3><code class=\"docutils literal notranslate\">FILE_UPLOAD_MAX_MEMORY_SIZE</code><a class=\"heading-anchor\" href=\"#file-upload-max-memory-size\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h3>\n<p>Default: <code class=\"docutils literal notranslate\">2621440</code> (i.e. 2.5 MB).</p>\n<p>The maximum size (in bytes) that an upload will be before it gets streamed to\nthe file system. See <a class=\"reference internal\" href=\"/it/4.1/topics/files/\"><span class=\"doc\">Managing files</span></a> for details.</p>\n<p>See also <a class=\"reference internal\" href=\"#std-setting-DATA_UPLOAD_MAX_MEMORY_SIZE\"><code class=\"xref std std-setting docutils literal notranslate\">DATA_UPLOAD_MAX_MEMORY_SIZE</code></a>.</p>\n</section>\n<section id=\"file-upload-directory-permissions\">\n<span id=\"std-setting-FILE_UPLOAD_DIRECTORY_PERMISSIONS\"></span><h3><code class=\"docutils literal notranslate\">FILE_UPLOAD_DIRECTORY_PERMISSIONS</code><a class=\"heading-anchor\" href=\"#file-upload-directory-permissions\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h3>\n<p>Default: <code class=\"docutils literal notranslate\">None</code></p>\n<p>The numeric mode to apply to directories created in the process of uploading\nfiles.</p>\n<p>This setting also determines the default permissions for collected static\ndirectories when using the <a class=\"reference internal\" href=\"/it/4.1/ref/contrib/staticfiles/#django-admin-collectstatic\"><code class=\"xref std std-djadmin docutils literal notranslate\">collectstatic</code></a> management command. See\n<a class=\"reference internal\" href=\"/it/4.1/ref/contrib/staticfiles/#django-admin-collectstatic\"><code class=\"xref std std-djadmin docutils literal notranslate\">collectstatic</code></a> for details on overriding it.</p>\n<p>This value mirrors the functionality and caveats of the\n<a class=\"reference internal\" href=\"#std-setting-FILE_UPLOAD_PERMISSIONS\"><code class=\"xref std std-setting docutils literal notranslate\">FILE_UPLOAD_PERMISSIONS</code></a> setting.</p>\n</section>\n<section id=\"file-upload-permissions\">\n<span id=\"std-setting-FILE_UPLOAD_PERMISSIONS\"></span><h3><code class=\"docutils literal notranslate\">FILE_UPLOAD_PERMISSIONS</code><a class=\"heading-anchor\" href=\"#file-upload-permissions\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h3>\n<p>Default: <code class=\"docutils literal notranslate\">0o644</code></p>\n<p>The numeric mode (i.e. <code class=\"docutils literal notranslate\">0o644</code>) to set newly uploaded files to. For\nmore information about what these modes mean, see the documentation for\n<a class=\"reference external\" href=\"https://docs.python.org/3/library/os.html#os.chmod\" title=\"(in Python v3.14)\"><code class=\"xref py py-func docutils literal notranslate\">os.chmod()</code></a>.</p>\n<p>If <code class=\"docutils literal notranslate\">None</code>, you’ll get operating-system dependent behavior. On most platforms,\ntemporary files will have a mode of <code class=\"docutils literal notranslate\">0o600</code>, and files saved from memory will\nbe saved using the system’s standard umask.</p>\n<p>For security reasons, these permissions aren’t applied to the temporary files\nthat are stored in <a class=\"reference internal\" href=\"#std-setting-FILE_UPLOAD_TEMP_DIR\"><code class=\"xref std std-setting docutils literal notranslate\">FILE_UPLOAD_TEMP_DIR</code></a>.</p>\n<p>This setting also determines the default permissions for collected static files\nwhen using the <a class=\"reference internal\" href=\"/it/4.1/ref/contrib/staticfiles/#django-admin-collectstatic\"><code class=\"xref std std-djadmin docutils literal notranslate\">collectstatic</code></a> management command. See\n<a class=\"reference internal\" href=\"/it/4.1/ref/contrib/staticfiles/#django-admin-collectstatic\"><code class=\"xref std std-djadmin docutils literal notranslate\">collectstatic</code></a> for details on overriding it.</p>\n<aside class=\"admonition admonition-warning\" role=\"note\">\n<p class=\"admonition-title\">Avvertimento</p>\n<p><strong>Always prefix the mode with</strong> <code class=\"docutils literal notranslate\">0o</code> <strong>.</strong></p>\n<p>If you’re not familiar with file modes, please note that the <code class=\"docutils literal notranslate\">0o</code> prefix\nis very important: it indicates an octal number, which is the way that\nmodes must be specified. If you try to use <code class=\"docutils literal notranslate\">644</code>, you’ll get totally\nincorrect behavior.</p>\n</aside>\n</section>\n<section id=\"file-upload-temp-dir\">\n<span id=\"std-setting-FILE_UPLOAD_TEMP_DIR\"></span><h3><code class=\"docutils literal notranslate\">FILE_UPLOAD_TEMP_DIR</code><a class=\"heading-anchor\" href=\"#file-upload-temp-dir\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h3>\n<p>Default: <code class=\"docutils literal notranslate\">None</code></p>\n<p>The directory to store data to (typically files larger than\n<a class=\"reference internal\" href=\"#std-setting-FILE_UPLOAD_MAX_MEMORY_SIZE\"><code class=\"xref std std-setting docutils literal notranslate\">FILE_UPLOAD_MAX_MEMORY_SIZE</code></a>) temporarily while uploading files.\nIf <code class=\"docutils literal notranslate\">None</code>, Django will use the standard temporary directory for the operating\nsystem. For example, this will default to <code class=\"docutils literal notranslate\">/tmp</code> on *nix-style operating\nsystems.</p>\n<p>See <a class=\"reference internal\" href=\"/it/4.1/topics/files/\"><span class=\"doc\">Managing files</span></a> for details.</p>\n</section>\n<section id=\"first-day-of-week\">\n<span id=\"std-setting-FIRST_DAY_OF_WEEK\"></span><h3><code class=\"docutils literal notranslate\">FIRST_DAY_OF_WEEK</code><a class=\"heading-anchor\" href=\"#first-day-of-week\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h3>\n<p>Default: <code class=\"docutils literal notranslate\">0</code> (Sunday)</p>\n<p>A number representing the first day of the week. This is especially useful\nwhen displaying a calendar. This value is only used when not using\nformat internationalization, or when a format cannot be found for the\ncurrent locale.</p>\n<p>The value must be an integer from 0 to 6, where 0 means Sunday, 1 means\nMonday and so on.</p>\n</section>\n<section id=\"fixture-dirs\">\n<span id=\"std-setting-FIXTURE_DIRS\"></span><h3><code class=\"docutils literal notranslate\">FIXTURE_DIRS</code><a class=\"heading-anchor\" href=\"#fixture-dirs\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h3>\n<p>Default: <code class=\"docutils literal notranslate\">[]</code> (Empty list)</p>\n<p>List of directories searched for fixture files, in addition to the\n<code class=\"docutils literal notranslate\">fixtures</code> directory of each application, in search order.</p>\n<p>Note that these paths should use Unix-style forward slashes, even on Windows.</p>\n<p>See <a class=\"reference internal\" href=\"/it/4.1/howto/initial-data/#initial-data-via-fixtures\"><span class=\"std std-ref\">Fornire dati con le fixtures</span></a> and <a class=\"reference internal\" href=\"/it/4.1/topics/testing/tools/#topics-testing-fixtures\"><span class=\"std std-ref\">Fixture loading</span></a>.</p>\n</section>\n<section id=\"force-script-name\">\n<span id=\"std-setting-FORCE_SCRIPT_NAME\"></span><h3><code class=\"docutils literal notranslate\">FORCE_SCRIPT_NAME</code><a class=\"heading-anchor\" href=\"#force-script-name\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h3>\n<p>Default: <code class=\"docutils literal notranslate\">None</code></p>\n<p>If not <code class=\"docutils literal notranslate\">None</code>, this will be used as the value of the <code class=\"docutils literal notranslate\">SCRIPT_NAME</code>\nenvironment variable in any HTTP request. This setting can be used to override\nthe server-provided value of <code class=\"docutils literal notranslate\">SCRIPT_NAME</code>, which may be a rewritten version\nof the preferred value or not supplied at all. It is also used by\n<a class=\"reference internal\" href=\"/it/4.1/ref/applications/#django.setup\" title=\"django.setup\"><code class=\"xref py py-func docutils literal notranslate\">django.setup()</code></a> to set the URL resolver script prefix outside of the\nrequest/response cycle (e.g. in management commands and standalone scripts) to\ngenerate correct URLs when <code class=\"docutils literal notranslate\">SCRIPT_NAME</code> is not <code class=\"docutils literal notranslate\">/</code>.</p>\n</section>\n<section id=\"form-renderer\">\n<span id=\"std-setting-FORM_RENDERER\"></span><h3><code class=\"docutils literal notranslate\">FORM_RENDERER</code><a class=\"heading-anchor\" href=\"#form-renderer\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h3>\n<p>Default: <code class=\"docutils literal notranslate\">'</code><a class=\"reference internal\" href=\"/it/4.1/ref/forms/renderers/#django.forms.renderers.DjangoTemplates\" title=\"django.forms.renderers.DjangoTemplates\"><code class=\"xref py py-class docutils literal notranslate\">django.forms.renderers.DjangoTemplates</code></a><code class=\"docutils literal notranslate\">'</code></p>\n<p>The class that renders forms and form widgets. It must implement\n<a class=\"reference internal\" href=\"/it/4.1/ref/forms/renderers/#low-level-widget-render-api\"><span class=\"std std-ref\">the low-level render API</span></a>. Included form\nrenderers are:</p>\n<ul class=\"simple\">\n<li><p><code class=\"docutils literal notranslate\">'</code><a class=\"reference internal\" href=\"/it/4.1/ref/forms/renderers/#django.forms.renderers.DjangoTemplates\" title=\"django.forms.renderers.DjangoTemplates\"><code class=\"xref py py-class docutils literal notranslate\">django.forms.renderers.DjangoTemplates</code></a><code class=\"docutils literal notranslate\">'</code></p></li>\n<li><p><code class=\"docutils literal notranslate\">'</code><a class=\"reference internal\" href=\"/it/4.1/ref/forms/renderers/#django.forms.renderers.Jinja2\" title=\"django.forms.renderers.Jinja2\"><code class=\"xref py py-class docutils literal notranslate\">django.forms.renderers.Jinja2</code></a><code class=\"docutils literal notranslate\">'</code></p></li>\n<li><p><code class=\"docutils literal notranslate\">'</code><a class=\"reference internal\" href=\"/it/4.1/ref/forms/renderers/#django.forms.renderers.TemplatesSetting\" title=\"django.forms.renderers.TemplatesSetting\"><code class=\"xref py py-class docutils literal notranslate\">django.forms.renderers.TemplatesSetting</code></a><code class=\"docutils literal notranslate\">'</code></p></li>\n</ul>\n</section>\n<section id=\"format-module-path\">\n<span id=\"std-setting-FORMAT_MODULE_PATH\"></span><h3><code class=\"docutils literal notranslate\">FORMAT_MODULE_PATH</code><a class=\"heading-anchor\" href=\"#format-module-path\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h3>\n<p>Default: <code class=\"docutils literal notranslate\">None</code></p>\n<p>A full Python path to a Python package that contains custom format definitions\nfor project locales. If not <code class=\"docutils literal notranslate\">None</code>, Django will check for a <code class=\"docutils literal notranslate\">formats.py</code>\nfile, under the directory named as the current locale, and will use the\nformats defined in this file.</p>\n<p>For example, if <a class=\"reference internal\" href=\"#std-setting-FORMAT_MODULE_PATH\"><code class=\"xref std std-setting docutils literal notranslate\">FORMAT_MODULE_PATH</code></a> is set to <code class=\"docutils literal notranslate\">mysite.formats</code>,\nand current language is <code class=\"docutils literal notranslate\">en</code> (English), Django will expect a directory tree\nlike:</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>mysite<span class=\"o\">/</span>\n    formats<span class=\"o\">/</span>\n        <span class=\"fm\">__init__</span><span class=\"o\">.</span>py\n        en<span class=\"o\">/</span>\n            <span class=\"fm\">__init__</span><span class=\"o\">.</span>py\n            formats<span class=\"o\">.</span>py\n</code></pre></div>\n<p>You can also set this setting to a list of Python paths, for example:</p>\n<div class=\"code-block\" data-language=\"default\"><div class=\"code-block-toolbar\"><span class=\"code-block-language\">Code</span><button type=\"button\" class=\"copy-button\" data-copy hidden><span class=\"copy-button-label\">Copy</span></button></div><pre role=\"group\" tabindex=\"0\" aria-label=\"Code code\"><code>FORMAT_MODULE_PATH <span class=\"o\">=</span> <span class=\"p\">[</span>\n    <span class=\"s1\">&#39;mysite.formats&#39;</span><span class=\"p\">,</span>\n    <span class=\"s1\">&#39;some_app.formats&#39;</span><span class=\"p\">,</span>\n<span class=\"p\">]</span>\n</code></pre></div>\n<p>When Django searches for a certain format, it will go through all given Python\npaths until it finds a module that actually defines the given format. This\nmeans that formats defined in packages farther up in the list will take\nprecedence over the same formats in packages farther down.</p>\n<p>Available formats are:</p>\n<ul class=\"simple\">\n<li><p><a class=\"reference internal\" href=\"#std-setting-DATE_FORMAT\"><code class=\"xref std std-setting docutils literal notranslate\">DATE_FORMAT</code></a></p></li>\n<li><p><a class=\"reference internal\" href=\"#std-setting-DATE_INPUT_FORMATS\"><code class=\"xref std std-setting docutils literal notranslate\">DATE_INPUT_FORMATS</code></a></p></li>\n<li><p><a class=\"reference internal\" href=\"#std-setting-DATETIME_FORMAT\"><code class=\"xref std std-setting docutils literal notranslate\">DATETIME_FORMAT</code></a>,</p></li>\n<li><p><a class=\"reference internal\" href=\"#std-setting-DATETIME_INPUT_FORMATS\"><code class=\"xref std std-setting docutils literal notranslate\">DATETIME_INPUT_FORMATS</code></a></p></li>\n<li><p><a class=\"reference internal\" href=\"#std-setting-DECIMAL_SEPARATOR\"><code class=\"xref std std-setting docutils literal notranslate\">DECIMAL_SEPARATOR</code></a></p></li>\n<li><p><a class=\"reference internal\" href=\"#std-setting-FIRST_DAY_OF_WEEK\"><code class=\"xref std std-setting docutils literal notranslate\">FIRST_DAY_OF_WEEK</code></a></p></li>\n<li><p><a class=\"reference internal\" href=\"#std-setting-MONTH_DAY_FORMAT\"><code class=\"xref std std-setting docutils literal notranslate\">MONTH_DAY_FORMAT</code></a></p></li>\n<li><p><a class=\"reference internal\" href=\"#std-setting-NUMBER_GROUPING\"><code class=\"xref std std-setting docutils literal notranslate\">NUMBER_GROUPING</code></a></p></li>\n<li><p><a class=\"reference internal\" href=\"#std-setting-SHORT_DATE_FORMAT\"><code class=\"xref std std-setting docutils literal notranslate\">SHORT_DATE_FORMAT</code></a></p></li>\n<li><p><a class=\"reference internal\" href=\"#std-setting-SHORT_DATETIME_FORMAT\"><code class=\"xref std std-setting docutils literal notranslate\">SHORT_DATETIME_FORMAT</code></a></p></li>\n<li><p><a class=\"reference internal\" href=\"#std-setting-THOUSAND_SEPARATOR\"><code class=\"xref std std-setting docutils literal notranslate\">THOUSAND_SEPARATOR</code></a></p></li>\n<li><p><a class=\"reference internal\" href=\"#std-setting-TIME_FORMAT\"><code class=\"xref std std-setting docutils literal notranslate\">TIME_FORMAT</code></a></p></li>\n<li><p><a class=\"reference internal\" href=\"#std-setting-TIME_INPUT_FORMATS\"><code class=\"xref std std-setting docutils literal notranslate\">TIME_INPUT_FORMATS</code></a></p></li>\n<li><p><a class=\"reference internal\" href=\"#std-setting-YEAR_MONTH_FORMAT\"><code class=\"xref std std-setting docutils literal notranslate\">YEAR_MONTH_FORMAT</code></a></p></li>\n</ul>\n</section>\n<section id=\"ignorable-404-urls\">\n<span id=\"std-setting-IGNORABLE_404_URLS\"></span><h3><code class=\"docutils literal notranslate\">IGNORABLE_404_URLS</code><a class=\"heading-anchor\" href=\"#ignorable-404-urls\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h3>\n<p>Default: <code class=\"docutils literal notranslate\">[]</code> (Empty list)</p>\n<p>List of compiled regular expression objects describing URLs that should be\nignored when reporting HTTP 404 errors via email (see\n<a class=\"reference internal\" href=\"/it/4.1/howto/error-reporting/\"><span class=\"doc\">Come gestire il report degli errori</span></a>). Regular expressions are matched against\n<a class=\"reference internal\" href=\"/it/4.1/ref/request-response/#django.http.HttpRequest.get_full_path\" title=\"django.http.HttpRequest.get_full_path\"><code class=\"xref py py-meth docutils literal notranslate\">request's full paths</code></a> (including\nquery string, if any). Use this if your site does not provide a commonly\nrequested file such as <code class=\"docutils literal notranslate\">favicon.ico</code> or <code class=\"docutils literal notranslate\">robots.txt</code>.</p>\n<p>This is only used if\n<a class=\"reference internal\" href=\"/it/4.1/ref/middleware/#django.middleware.common.BrokenLinkEmailsMiddleware\" title=\"django.middleware.common.BrokenLinkEmailsMiddleware\"><code class=\"xref py py-class docutils literal notranslate\">BrokenLinkEmailsMiddleware</code></a> is enabled (see\n<a class=\"reference internal\" href=\"/it/4.1/topics/http/middleware/\"><span class=\"doc\">Middleware</span></a>).</p>\n</section>\n<section id=\"installed-apps\">\n<span id=\"std-setting-INSTALLED_APPS\"></span><h3><code class=\"docutils literal notranslate\">INSTALLED_APPS</code><a class=\"heading-anchor\" href=\"#installed-apps\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h3>\n<p>Default: <code class=\"docutils literal notranslate\">[]</code> (Empty list)</p>\n<p>A list of strings designating all applications that are enabled in this\nDjango installation. Each string should be a dotted Python path to:</p>\n<ul class=\"simple\">\n<li><p>an application configuration class (preferred), or</p></li>\n<li><p>a package containing an application.</p></li>\n</ul>\n<p><a class=\"reference internal\" href=\"/it/4.1/ref/applications/\"><span class=\"doc\">Learn more about application configurations</span></a>.</p>\n<aside class=\"admonition-use-the-application-registry-for-introspection admonition\" role=\"note\">\n<p class=\"admonition-title\">Use the application registry for introspection</p>\n<p>Your code should never access <a class=\"reference internal\" href=\"#std-setting-INSTALLED_APPS\"><code class=\"xref std std-setting docutils literal notranslate\">INSTALLED_APPS</code></a> directly. Use\n<a class=\"reference internal\" href=\"/it/4.1/ref/applications/#django.apps.apps\" title=\"django.apps.apps\"><code class=\"xref py py-attr docutils literal notranslate\">django.apps.apps</code></a> instead.</p>\n</aside>\n<aside class=\"admonition-application-names-and-labels-must-be-unique-in-setting-installed-apps admonition\" role=\"note\">\n<p class=\"admonition-title\">Application names and labels must be unique in\n            <a class=\"reference internal\" href=\"#std-setting-INSTALLED_APPS\"><code class=\"xref std std-setting docutils literal notranslate\">INSTALLED_APPS</code></a></p>\n<p>Application <a class=\"reference internal\" href=\"/it/4.1/ref/applications/#django.apps.AppConfig.name\" title=\"django.apps.AppConfig.name\"><code class=\"xref py py-attr docutils literal notranslate\">names</code></a> — the dotted Python\npath to the application package — must be unique. There is no way to\ninclude the same application twice, short of duplicating its code under\nanother name.</p>\n<p>Application <a class=\"reference internal\" href=\"/it/4.1/ref/applications/#django.apps.AppConfig.label\" title=\"django.apps.AppConfig.label\"><code class=\"xref py py-attr docutils literal notranslate\">labels</code></a> — by default the\nfinal part of the name — must be unique too. For example, you can’t\ninclude both <code class=\"docutils literal notranslate\">django.contrib.auth</code> and <code class=\"docutils literal notranslate\">myproject.auth</code>. However, you\ncan relabel an application with a custom configuration that defines a\ndifferent <a class=\"reference internal\" href=\"/it/4.1/ref/applications/#django.apps.AppConfig.label\" title=\"django.apps.AppConfig.label\"><code class=\"xref py py-attr docutils literal notranslate\">label</code></a>.</p>\n<p>These rules apply regardless of whether <a class=\"reference internal\" href=\"#std-setting-INSTALLED_APPS\"><code class=\"xref std std-setting docutils literal notranslate\">INSTALLED_APPS</code></a>\nreferences application configuration classes or application packages.</p>\n</aside>\n<p>When several applications provide different versions of the same resource\n(template, static file, management command, translation), the application\nlisted first in <a class=\"reference internal\" href=\"#std-setting-INSTALLED_APPS\"><code class=\"xref std std-setting docutils literal notranslate\">INSTALLED_APPS</code></a> has precedence.</p>\n</section>\n<section id=\"internal-ips\">\n<span id=\"std-setting-INTERNAL_IPS\"></span><h3><code class=\"docutils literal notranslate\">INTERNAL_IPS</code><a class=\"heading-anchor\" href=\"#internal-ips\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h3>\n<p>Default: <code class=\"docutils literal notranslate\">[]</code> (Empty list)</p>\n<p>A list of IP addresses, as strings, that:</p>\n<ul class=\"simple\">\n<li><p>Allow the <a class=\"reference internal\" href=\"/it/4.1/ref/templates/api/#django.template.context_processors.debug\" title=\"django.template.context_processors.debug\"><code class=\"xref py py-func docutils literal notranslate\">debug()</code></a> context processor\nto add some variables to the template context.</p></li>\n<li><p>Can use the <a class=\"reference internal\" href=\"/it/4.1/ref/contrib/admin/admindocs/#admindocs-bookmarklets\"><span class=\"std std-ref\">admindocs bookmarklets</span></a> even if\nnot logged in as a staff user.</p></li>\n<li><p>Are marked as «internal» (as opposed to «EXTERNAL») in\n<a class=\"reference internal\" href=\"/it/4.1/ref/logging/#django.utils.log.AdminEmailHandler\" title=\"django.utils.log.AdminEmailHandler\"><code class=\"xref py py-class docutils literal notranslate\">AdminEmailHandler</code></a> emails.</p></li>\n</ul>\n</section>\n<section id=\"language-code\">\n<span id=\"std-setting-LANGUAGE_CODE\"></span><h3><code class=\"docutils literal notranslate\">LANGUAGE_CODE</code><a class=\"heading-anchor\" href=\"#language-code\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h3>\n<p>Default: <code class=\"docutils literal notranslate\">'en-us'</code></p>\n<p>A string representing the language code for this installation. This should be in\nstandard <a class=\"reference internal\" href=\"/it/4.1/topics/i18n/#term-language-code\"><span class=\"xref std std-term\">language ID format</span></a>. For example, U.S. English\nis <code class=\"docutils literal notranslate\">&quot;en-us&quot;</code>. See also the <a class=\"reference external\" href=\"http://www.i18nguy.com/unicode/language-identifiers.html\">list of language identifiers</a> and\n<a class=\"reference internal\" href=\"/it/4.1/topics/i18n/\"><span class=\"doc\">Internationalization and localization</span></a>.</p>\n<p><a class=\"reference internal\" href=\"#std-setting-USE_I18N\"><code class=\"xref std std-setting docutils literal notranslate\">USE_I18N</code></a> must be active for this setting to have any effect.</p>\n<p>It serves two purposes:</p>\n<ul class=\"simple\">\n<li><p>If the locale middleware isn’t in use, it decides which translation is served\nto all users.</p></li>\n<li><p>If the locale middleware is active, it provides a fallback language in case the\nuser’s preferred language can’t be determined or is not supported by the\nwebsite. It also provides the fallback translation when a translation for a\ngiven literal doesn’t exist for the user’s preferred language.</p></li>\n</ul>\n<p>See <a class=\"reference internal\" href=\"/it/4.1/topics/i18n/translation/#how-django-discovers-language-preference\"><span class=\"std std-ref\">How Django discovers language preference</span></a> for more details.</p>\n</section>\n<section id=\"language-cookie-age\">\n<span id=\"std-setting-LANGUAGE_COOKIE_AGE\"></span><h3><code class=\"docutils literal notranslate\">LANGUAGE_COOKIE_AGE</code><a class=\"heading-anchor\" href=\"#language-cookie-age\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h3>\n<p>Default: <code class=\"docutils literal notranslate\">None</code> (expires at browser close)</p>\n<p>The age of the language cookie, in seconds.</p>\n</section>\n<section id=\"language-cookie-domain\">\n<span id=\"std-setting-LANGUAGE_COOKIE_DOMAIN\"></span><h3><code class=\"docutils literal notranslate\">LANGUAGE_COOKIE_DOMAIN</code><a class=\"heading-anchor\" href=\"#language-cookie-domain\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h3>\n<p>Default: <code class=\"docutils literal notranslate\">None</code></p>\n<p>The domain to use for the language cookie. Set this to a string such as\n<code class=\"docutils literal notranslate\">&quot;example.com&quot;</code> for cross-domain cookies, or use <code class=\"docutils literal notranslate\">None</code> for a standard\ndomain cookie.</p>\n<p>Be cautious when updating this setting on a production site. If you update\nthis setting to enable cross-domain cookies on a site that previously used\nstandard domain cookies, existing user cookies that have the old domain\nwill not be updated. This will result in site users being unable to switch\nthe language as long as these cookies persist. The only safe and reliable\noption to perform the switch is to change the language cookie name\npermanently (via the <a class=\"reference internal\" href=\"#std-setting-LANGUAGE_COOKIE_NAME\"><code class=\"xref std std-setting docutils literal notranslate\">LANGUAGE_COOKIE_NAME</code></a> setting) and to add\na middleware that copies the value from the old cookie to a new one and then\ndeletes the old one.</p>\n</section>\n<section id=\"language-cookie-httponly\">\n<span id=\"std-setting-LANGUAGE_COOKIE_HTTPONLY\"></span><h3><code class=\"docutils literal notranslate\">LANGUAGE_COOKIE_HTTPONLY</code><a class=\"heading-anchor\" href=\"#language-cookie-httponly\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h3>\n<p>Default: <code class=\"docutils literal notranslate\">False</code></p>\n<p>Whether to use <code class=\"docutils literal notranslate\">HttpOnly</code> flag on the language cookie. If this is set to\n<code class=\"docutils literal notranslate\">True</code>, client-side JavaScript will not be able to access the language\ncookie.</p>\n<p>See <a class=\"reference internal\" href=\"#std-setting-SESSION_COOKIE_HTTPONLY\"><code class=\"xref std std-setting docutils literal notranslate\">SESSION_COOKIE_HTTPONLY</code></a> for details on <code class=\"docutils literal notranslate\">HttpOnly</code>.</p>\n</section>\n<section id=\"language-cookie-name\">\n<span id=\"std-setting-LANGUAGE_COOKIE_NAME\"></span><h3><code class=\"docutils literal notranslate\">LANGUAGE_COOKIE_NAME</code><a class=\"heading-anchor\" href=\"#language-cookie-name\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h3>\n<p>Default: <code class=\"docutils literal notranslate\">'django_language'</code></p>\n<p>The name of the cookie to use for the language cookie. This can be whatever\nyou want (as long as it’s different from the other cookie names in your\napplication). See <a class=\"reference internal\" href=\"/it/4.1/topics/i18n/\"><span class=\"doc\">Internationalization and localization</span></a>.</p>\n</section>\n<section id=\"language-cookie-path\">\n<span id=\"std-setting-LANGUAGE_COOKIE_PATH\"></span><h3><code class=\"docutils literal notranslate\">LANGUAGE_COOKIE_PATH</code><a class=\"heading-anchor\" href=\"#language-cookie-path\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h3>\n<p>Default: <code class=\"docutils literal notranslate\">'/'</code></p>\n<p>The path set on the language cookie. This should either match the URL path of your\nDjango installation or be a parent of that path.</p>\n<p>This is useful if you have multiple Django instances running under the same\nhostname. They can use different cookie paths and each instance will only see\nits own language cookie.</p>\n<p>Be cautious when updating this setting on a production site. If you update this\nsetting to use a deeper path than it previously used, existing user cookies that\nhave the old path will not be updated. This will result in site users being\nunable to switch the language as long as these cookies persist. The only safe\nand reliable option to perform the switch is to change the language cookie name\npermanently (via the <a class=\"reference internal\" href=\"#std-setting-LANGUAGE_COOKIE_NAME\"><code class=\"xref std std-setting docutils literal notranslate\">LANGUAGE_COOKIE_NAME</code></a> setting), and to add\na middleware that copies the value from the old cookie to a new one and then\ndeletes the one.</p>\n</section>\n<section id=\"language-cookie-samesite\">\n<span id=\"std-setting-LANGUAGE_COOKIE_SAMESITE\"></span><h3><code class=\"docutils literal notranslate\">LANGUAGE_COOKIE_SAMESITE</code><a class=\"heading-anchor\" href=\"#language-cookie-samesite\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h3>\n<p>Default: <code class=\"docutils literal notranslate\">None</code></p>\n<p>The value of the <a class=\"reference external\" href=\"https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Set-Cookie/SameSite\">SameSite</a> flag on the language cookie. This flag prevents the\ncookie from being sent in cross-site requests.</p>\n<p>See <a class=\"reference internal\" href=\"#std-setting-SESSION_COOKIE_SAMESITE\"><code class=\"xref std std-setting docutils literal notranslate\">SESSION_COOKIE_SAMESITE</code></a> for details about <code class=\"docutils literal notranslate\">SameSite</code>.</p>\n</section>\n<section id=\"language-cookie-secure\">\n<span id=\"std-setting-LANGUAGE_COOKIE_SECURE\"></span><h3><code class=\"docutils literal notranslate\">LANGUAGE_COOKIE_SECURE</code><a class=\"heading-anchor\" href=\"#language-cookie-secure\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h3>\n<p>Default: <code class=\"docutils literal notranslate\">False</code></p>\n<p>Whether to use a secure cookie for the language cookie. If this is set to\n<code class=\"docutils literal notranslate\">True</code>, the cookie will be marked as «secure», which means browsers may\nensure that the cookie is only sent under an HTTPS connection.</p>\n</section>\n<section id=\"languages\">\n<span id=\"std-setting-LANGUAGES\"></span><h3><code class=\"docutils literal notranslate\">LANGUAGES</code><a class=\"heading-anchor\" href=\"#languages\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h3>\n<p>Default: A list of all available languages. This list is continually growing\nand including a copy here would inevitably become rapidly out of date. You can\nsee the current list of translated languages by looking in\n<a class=\"extlink-source reference external\" href=\"https://github.com/django/django/blob/stable/4.1.x/django/conf/global_settings.py\">django/conf/global_settings.py</a>.</p>\n<p>The list is a list of two-tuples in the format\n(<a class=\"reference internal\" href=\"/it/4.1/topics/i18n/#term-language-code\"><span class=\"xref std std-term\">language code</span></a>, <code class=\"docutils literal notranslate\">language name</code>) – for example,\n<code class=\"docutils literal notranslate\">('ja', 'Japanese')</code>.\nThis specifies which languages are available for language selection. See\n<a class=\"reference internal\" href=\"/it/4.1/topics/i18n/\"><span class=\"doc\">Internationalization and localization</span></a>.</p>\n<p>Generally, the default value should suffice. Only set this setting if you want\nto restrict language selection to a subset of the Django-provided languages.</p>\n<p>If you define a custom <a class=\"reference internal\" href=\"#std-setting-LANGUAGES\"><code class=\"xref std std-setting docutils literal notranslate\">LANGUAGES</code></a> setting, you can mark the\nlanguage names as translation strings using the\n<a class=\"reference internal\" href=\"/it/4.1/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> function.</p>\n<p>Here’s a sample settings file:</p>\n<div class=\"code-block\" data-language=\"default\"><div class=\"code-block-toolbar\"><span class=\"code-block-language\">Code</span><button type=\"button\" class=\"copy-button\" data-copy hidden><span class=\"copy-button-label\">Copy</span></button></div><pre role=\"group\" tabindex=\"0\" aria-label=\"Code code\"><code><span class=\"kn\">from</span> <span class=\"nn\">django.utils.translation</span> <span class=\"kn\">import</span> gettext_lazy <span class=\"k\">as</span> _\n\nLANGUAGES <span class=\"o\">=</span> <span class=\"p\">[</span>\n    <span class=\"p\">(</span><span class=\"s1\">&#39;de&#39;</span><span class=\"p\">,</span> _<span class=\"p\">(</span><span class=\"s1\">&#39;German&#39;</span><span class=\"p\">)),</span>\n    <span class=\"p\">(</span><span class=\"s1\">&#39;en&#39;</span><span class=\"p\">,</span> _<span class=\"p\">(</span><span class=\"s1\">&#39;English&#39;</span><span class=\"p\">)),</span>\n<span class=\"p\">]</span>\n</code></pre></div>\n</section>\n<section id=\"languages-bidi\">\n<span id=\"std-setting-LANGUAGES_BIDI\"></span><h3><code class=\"docutils literal notranslate\">LANGUAGES_BIDI</code><a class=\"heading-anchor\" href=\"#languages-bidi\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h3>\n<p>Default: A list of all language codes that are written right-to-left. You can\nsee the current list of these languages by looking in\n<a class=\"extlink-source reference external\" href=\"https://github.com/django/django/blob/stable/4.1.x/django/conf/global_settings.py\">django/conf/global_settings.py</a>.</p>\n<p>The list contains <a class=\"reference internal\" href=\"/it/4.1/topics/i18n/#term-language-code\"><span class=\"xref std std-term\">language codes</span></a> for languages that are\nwritten right-to-left.</p>\n<p>Generally, the default value should suffice. Only set this setting if you want\nto restrict language selection to a subset of the Django-provided languages.\nIf you define a custom <a class=\"reference internal\" href=\"#std-setting-LANGUAGES\"><code class=\"xref std std-setting docutils literal notranslate\">LANGUAGES</code></a> setting, the list of bidirectional\nlanguages may contain language codes which are not enabled on a given site.</p>\n</section>\n<section id=\"locale-paths\">\n<span id=\"std-setting-LOCALE_PATHS\"></span><h3><code class=\"docutils literal notranslate\">LOCALE_PATHS</code><a class=\"heading-anchor\" href=\"#locale-paths\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h3>\n<p>Default: <code class=\"docutils literal notranslate\">[]</code> (Empty list)</p>\n<p>A list of directories where Django looks for translation files.\nSee <a class=\"reference internal\" href=\"/it/4.1/topics/i18n/translation/#how-django-discovers-translations\"><span class=\"std std-ref\">How Django discovers translations</span></a>.</p>\n<p>Example:</p>\n<div class=\"code-block\" data-language=\"default\"><div class=\"code-block-toolbar\"><span class=\"code-block-language\">Code</span><button type=\"button\" class=\"copy-button\" data-copy hidden><span class=\"copy-button-label\">Copy</span></button></div><pre role=\"group\" tabindex=\"0\" aria-label=\"Code code\"><code>LOCALE_PATHS <span class=\"o\">=</span> <span class=\"p\">[</span>\n    <span class=\"s1\">&#39;/home/www/project/common_files/locale&#39;</span><span class=\"p\">,</span>\n    <span class=\"s1\">&#39;/var/local/translations/locale&#39;</span><span class=\"p\">,</span>\n<span class=\"p\">]</span>\n</code></pre></div>\n<p>Django will look within each of these paths for the <code class=\"docutils literal notranslate\">&lt;locale_code&gt;/LC_MESSAGES</code>\ndirectories containing the actual translation files.</p>\n</section>\n<section id=\"logging\">\n<span id=\"std-setting-LOGGING\"></span><h3><code class=\"docutils literal notranslate\">LOGGING</code><a class=\"heading-anchor\" href=\"#logging\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h3>\n<p>Default: A logging configuration dictionary.</p>\n<p>A data structure containing configuration information. When not-empty, the\ncontents of this data structure will be passed as the argument to the\nconfiguration method described in <a class=\"reference internal\" href=\"#std-setting-LOGGING_CONFIG\"><code class=\"xref std std-setting docutils literal notranslate\">LOGGING_CONFIG</code></a>.</p>\n<p>Among other things, the default logging configuration passes HTTP 500 server\nerrors to an email log handler when <a class=\"reference internal\" href=\"#std-setting-DEBUG\"><code class=\"xref std std-setting docutils literal notranslate\">DEBUG</code></a> is <code class=\"docutils literal notranslate\">False</code>. See also\n<a class=\"reference internal\" href=\"/it/4.1/topics/logging/#configuring-logging\"><span class=\"std std-ref\">Configuring logging</span></a>.</p>\n<p>You can see the default logging configuration by looking in\n<a class=\"extlink-source reference external\" href=\"https://github.com/django/django/blob/stable/4.1.x/django/utils/log.py\">django/utils/log.py</a>.</p>\n</section>\n<section id=\"logging-config\">\n<span id=\"std-setting-LOGGING_CONFIG\"></span><h3><code class=\"docutils literal notranslate\">LOGGING_CONFIG</code><a class=\"heading-anchor\" href=\"#logging-config\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h3>\n<p>Default: <code class=\"docutils literal notranslate\">'logging.config.dictConfig'</code></p>\n<p>A path to a callable that will be used to configure logging in the\nDjango project. Points at an instance of Python’s <a class=\"reference external\" href=\"https://docs.python.org/3/library/logging.config.html#logging-config-dictschema\" title=\"(in Python v3.14)\"><span class=\"xref std std-ref\">dictConfig</span></a> configuration method by default.</p>\n<p>If you set <a class=\"reference internal\" href=\"#std-setting-LOGGING_CONFIG\"><code class=\"xref std std-setting docutils literal notranslate\">LOGGING_CONFIG</code></a> to <code class=\"docutils literal notranslate\">None</code>, the logging\nconfiguration process will be skipped.</p>\n</section>\n<section id=\"managers\">\n<span id=\"std-setting-MANAGERS\"></span><h3><code class=\"docutils literal notranslate\">MANAGERS</code><a class=\"heading-anchor\" href=\"#managers\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h3>\n<p>Default: <code class=\"docutils literal notranslate\">[]</code> (Empty list)</p>\n<p>A list in the same format as <a class=\"reference internal\" href=\"#std-setting-ADMINS\"><code class=\"xref std std-setting docutils literal notranslate\">ADMINS</code></a> that specifies who should get\nbroken link notifications when\n<a class=\"reference internal\" href=\"/it/4.1/ref/middleware/#django.middleware.common.BrokenLinkEmailsMiddleware\" title=\"django.middleware.common.BrokenLinkEmailsMiddleware\"><code class=\"xref py py-class docutils literal notranslate\">BrokenLinkEmailsMiddleware</code></a> is enabled.</p>\n</section>\n<section id=\"media-root\">\n<span id=\"std-setting-MEDIA_ROOT\"></span><h3><code class=\"docutils literal notranslate\">MEDIA_ROOT</code><a class=\"heading-anchor\" href=\"#media-root\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h3>\n<p>Default: <code class=\"docutils literal notranslate\">''</code> (Empty string)</p>\n<p>Absolute filesystem path to the directory that will hold <a class=\"reference internal\" href=\"/it/4.1/topics/files/\"><span class=\"doc\">user-uploaded\nfiles</span></a>.</p>\n<p>Example: <code class=\"docutils literal notranslate\">&quot;/var/www/example.com/media/&quot;</code></p>\n<p>See also <a class=\"reference internal\" href=\"#std-setting-MEDIA_URL\"><code class=\"xref std std-setting docutils literal notranslate\">MEDIA_URL</code></a>.</p>\n<aside class=\"admonition admonition-warning\" role=\"note\">\n<p class=\"admonition-title\">Avvertimento</p>\n<p><a class=\"reference internal\" href=\"#std-setting-MEDIA_ROOT\"><code class=\"xref std std-setting docutils literal notranslate\">MEDIA_ROOT</code></a> and <a class=\"reference internal\" href=\"#std-setting-STATIC_ROOT\"><code class=\"xref std std-setting docutils literal notranslate\">STATIC_ROOT</code></a> must have different\nvalues. Before <a class=\"reference internal\" href=\"#std-setting-STATIC_ROOT\"><code class=\"xref std std-setting docutils literal notranslate\">STATIC_ROOT</code></a> was introduced, it was common to\nrely or fallback on <a class=\"reference internal\" href=\"#std-setting-MEDIA_ROOT\"><code class=\"xref std std-setting docutils literal notranslate\">MEDIA_ROOT</code></a> to also serve static files;\nhowever, since this can have serious security implications, there is a\nvalidation check to prevent it.</p>\n</aside>\n</section>\n<section id=\"media-url\">\n<span id=\"std-setting-MEDIA_URL\"></span><h3><code class=\"docutils literal notranslate\">MEDIA_URL</code><a class=\"heading-anchor\" href=\"#media-url\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h3>\n<p>Default: <code class=\"docutils literal notranslate\">''</code> (Empty string)</p>\n<p>URL that handles the media served from <a class=\"reference internal\" href=\"#std-setting-MEDIA_ROOT\"><code class=\"xref std std-setting docutils literal notranslate\">MEDIA_ROOT</code></a>, used\nfor <a class=\"reference internal\" href=\"/it/4.1/topics/files/\"><span class=\"doc\">managing stored files</span></a>. It must end in a slash if set\nto a non-empty value. You will need to <a class=\"reference internal\" href=\"/it/4.1/howto/static-files/#serving-uploaded-files-in-development\"><span class=\"std std-ref\">configure these files to be served</span></a> in both development and production\nenvironments.</p>\n<p>If you want to use <code class=\"docutils literal notranslate\">{{ MEDIA_URL }}</code> in your templates, add\n<code class=\"docutils literal notranslate\">'django.template.context_processors.media'</code> in the <code class=\"docutils literal notranslate\">'context_processors'</code>\noption of <a class=\"reference internal\" href=\"#std-setting-TEMPLATES\"><code class=\"xref std std-setting docutils literal notranslate\">TEMPLATES</code></a>.</p>\n<p>Example: <code class=\"docutils literal notranslate\">&quot;http://media.example.com/&quot;</code></p>\n<aside class=\"admonition admonition-warning\" role=\"note\">\n<p class=\"admonition-title\">Avvertimento</p>\n<p>There are security risks if you are accepting uploaded content from\nuntrusted users! See the security guide’s topic on\n<a class=\"reference internal\" href=\"/it/4.1/topics/security/#user-uploaded-content-security\"><span class=\"std std-ref\">User-uploaded content</span></a> for mitigation details.</p>\n</aside>\n<aside class=\"admonition admonition-warning\" role=\"note\">\n<p class=\"admonition-title\">Avvertimento</p>\n<p><a class=\"reference internal\" href=\"#std-setting-MEDIA_URL\"><code class=\"xref std std-setting docutils literal notranslate\">MEDIA_URL</code></a> and <a class=\"reference internal\" href=\"#std-setting-STATIC_URL\"><code class=\"xref std std-setting docutils literal notranslate\">STATIC_URL</code></a> must have different\nvalues. See <a class=\"reference internal\" href=\"#std-setting-MEDIA_ROOT\"><code class=\"xref std std-setting docutils literal notranslate\">MEDIA_ROOT</code></a> for more details.</p>\n</aside>\n<aside class=\"admonition admonition-note\" role=\"note\">\n<p class=\"admonition-title\">Nota</p>\n<p>If <a class=\"reference internal\" href=\"#std-setting-MEDIA_URL\"><code class=\"xref std std-setting docutils literal notranslate\">MEDIA_URL</code></a> is a relative path, then it will be prefixed by the\nserver-provided value of <code class=\"docutils literal notranslate\">SCRIPT_NAME</code> (or <code class=\"docutils literal notranslate\">/</code> if not set). This makes\nit easier to serve a Django application in a subpath without adding an\nextra configuration to the settings.</p>\n</aside>\n</section>\n<section id=\"middleware\">\n<span id=\"std-setting-MIDDLEWARE\"></span><h3><code class=\"docutils literal notranslate\">MIDDLEWARE</code><a class=\"heading-anchor\" href=\"#middleware\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h3>\n<p>Default: <code class=\"docutils literal notranslate\">None</code></p>\n<p>A list of middleware to use. See <a class=\"reference internal\" href=\"/it/4.1/topics/http/middleware/\"><span class=\"doc\">Middleware</span></a>.</p>\n</section>\n<section id=\"migration-modules\">\n<span id=\"std-setting-MIGRATION_MODULES\"></span><h3><code class=\"docutils literal notranslate\">MIGRATION_MODULES</code><a class=\"heading-anchor\" href=\"#migration-modules\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h3>\n<p>Default: <code class=\"docutils literal notranslate\">{}</code> (Empty dictionary)</p>\n<p>A dictionary specifying the package where migration modules can be found on a\nper-app basis. The default value of this setting is an empty dictionary, but\nthe default package name for migration modules is <code class=\"docutils literal notranslate\">migrations</code>.</p>\n<p>Example:</p>\n<div class=\"code-block\" data-language=\"default\"><div class=\"code-block-toolbar\"><span class=\"code-block-language\">Code</span><button type=\"button\" class=\"copy-button\" data-copy hidden><span class=\"copy-button-label\">Copy</span></button></div><pre role=\"group\" tabindex=\"0\" aria-label=\"Code code\"><code><span class=\"p\">{</span><span class=\"s1\">&#39;blog&#39;</span><span class=\"p\">:</span> <span class=\"s1\">&#39;blog.db_migrations&#39;</span><span class=\"p\">}</span>\n</code></pre></div>\n<p>In this case, migrations pertaining to the <code class=\"docutils literal notranslate\">blog</code> app will be contained in\nthe <code class=\"docutils literal notranslate\">blog.db_migrations</code> package.</p>\n<p>If you provide the <code class=\"docutils literal notranslate\">app_label</code> argument, <a class=\"reference internal\" href=\"/it/4.1/ref/django-admin/#django-admin-makemigrations\"><code class=\"xref std std-djadmin docutils literal notranslate\">makemigrations</code></a> will\nautomatically create the package if it doesn’t already exist.</p>\n<p>When you supply <code class=\"docutils literal notranslate\">None</code> as a value for an app, Django will consider the app as\nan app without migrations regardless of an existing <code class=\"docutils literal notranslate\">migrations</code> submodule.\nThis can be used, for example, in a test settings file to skip migrations while\ntesting (tables will still be created for the apps” models). To disable\nmigrations for all apps during tests, you can set the\n<a class=\"reference internal\" href=\"#std-setting-TEST_MIGRATE\"><code class=\"xref std std-setting docutils literal notranslate\">MIGRATE</code></a> to <code class=\"docutils literal notranslate\">False</code> instead. If\n<code class=\"docutils literal notranslate\">MIGRATION_MODULES</code> is used in your general project settings, remember to use\nthe <a class=\"reference internal\" href=\"/it/4.1/ref/django-admin/#cmdoption-migrate-run-syncdb\"><code class=\"xref std std-option docutils literal notranslate\">migrate --run-syncdb</code></a> option if you want to create tables for the\napp.</p>\n</section>\n<section id=\"month-day-format\">\n<span id=\"std-setting-MONTH_DAY_FORMAT\"></span><h3><code class=\"docutils literal notranslate\">MONTH_DAY_FORMAT</code><a class=\"heading-anchor\" href=\"#month-day-format\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h3>\n<p>Default: <code class=\"docutils literal notranslate\">'F j'</code></p>\n<p>The default formatting to use for date fields on Django admin change-list\npages – and, possibly, by other parts of the system – in cases when only the\nmonth and day are displayed.</p>\n<p>For example, when a Django admin change-list page is being filtered by a date\ndrilldown, the header for a given day displays the day and month. Different\nlocales have different formats. For example, U.S. English would say\n«January 1,» whereas Spanish might say «1 Enero.»</p>\n<p>Note that if <a class=\"reference internal\" href=\"#std-setting-USE_L10N\"><code class=\"xref std std-setting docutils literal notranslate\">USE_L10N</code></a> is set to <code class=\"docutils literal notranslate\">True</code>, then the corresponding\nlocale-dictated format has higher precedence and will be applied.</p>\n<p>See <a class=\"reference internal\" href=\"/it/4.1/ref/templates/builtins/#std-templatefilter-date\"><code class=\"xref std std-tfilter docutils literal notranslate\">allowed date format strings</code></a>. See also\n<a class=\"reference internal\" href=\"#std-setting-DATE_FORMAT\"><code class=\"xref std std-setting docutils literal notranslate\">DATE_FORMAT</code></a>, <a class=\"reference internal\" href=\"#std-setting-DATETIME_FORMAT\"><code class=\"xref std std-setting docutils literal notranslate\">DATETIME_FORMAT</code></a>,\n<a class=\"reference internal\" href=\"#std-setting-TIME_FORMAT\"><code class=\"xref std std-setting docutils literal notranslate\">TIME_FORMAT</code></a> and <a class=\"reference internal\" href=\"#std-setting-YEAR_MONTH_FORMAT\"><code class=\"xref std std-setting docutils literal notranslate\">YEAR_MONTH_FORMAT</code></a>.</p>\n</section>\n<section id=\"number-grouping\">\n<span id=\"std-setting-NUMBER_GROUPING\"></span><h3><code class=\"docutils literal notranslate\">NUMBER_GROUPING</code><a class=\"heading-anchor\" href=\"#number-grouping\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h3>\n<p>Default: <code class=\"docutils literal notranslate\">0</code></p>\n<p>Number of digits grouped together on the integer part of a number.</p>\n<p>Common use is to display a thousand separator. If this setting is <code class=\"docutils literal notranslate\">0</code>, then\nno grouping will be applied to the number. If this setting is greater than\n<code class=\"docutils literal notranslate\">0</code>, then <a class=\"reference internal\" href=\"#std-setting-THOUSAND_SEPARATOR\"><code class=\"xref std std-setting docutils literal notranslate\">THOUSAND_SEPARATOR</code></a> will be used as the separator between\nthose groups.</p>\n<p>Some locales use non-uniform digit grouping, e.g. <code class=\"docutils literal notranslate\">10,00,00,000</code> in\n<code class=\"docutils literal notranslate\">en_IN</code>. For this case, you can provide a sequence with the number of digit\ngroup sizes to be applied. The first number defines the size of the group\npreceding the decimal delimiter, and each number that follows defines the size\nof preceding groups. If the sequence is terminated with <code class=\"docutils literal notranslate\">-1</code>, no further\ngrouping is performed. If the sequence terminates with a <code class=\"docutils literal notranslate\">0</code>, the last group\nsize is used for the remainder of the number.</p>\n<p>Example tuple for <code class=\"docutils literal notranslate\">en_IN</code>:</p>\n<div class=\"code-block\" data-language=\"default\"><div class=\"code-block-toolbar\"><span class=\"code-block-language\">Code</span><button type=\"button\" class=\"copy-button\" data-copy hidden><span class=\"copy-button-label\">Copy</span></button></div><pre role=\"group\" tabindex=\"0\" aria-label=\"Code code\"><code>NUMBER_GROUPING <span class=\"o\">=</span> <span class=\"p\">(</span><span class=\"mi\">3</span><span class=\"p\">,</span> <span class=\"mi\">2</span><span class=\"p\">,</span> <span class=\"mi\">0</span><span class=\"p\">)</span>\n</code></pre></div>\n<p>Note that if <a class=\"reference internal\" href=\"#std-setting-USE_L10N\"><code class=\"xref std std-setting docutils literal notranslate\">USE_L10N</code></a> is set to <code class=\"docutils literal notranslate\">True</code>, then the locale-dictated\nformat has higher precedence and will be applied instead.</p>\n<p>See also <a class=\"reference internal\" href=\"#std-setting-DECIMAL_SEPARATOR\"><code class=\"xref std std-setting docutils literal notranslate\">DECIMAL_SEPARATOR</code></a>, <a class=\"reference internal\" href=\"#std-setting-THOUSAND_SEPARATOR\"><code class=\"xref std std-setting docutils literal notranslate\">THOUSAND_SEPARATOR</code></a> and\n<a class=\"reference internal\" href=\"#std-setting-USE_THOUSAND_SEPARATOR\"><code class=\"xref std std-setting docutils literal notranslate\">USE_THOUSAND_SEPARATOR</code></a>.</p>\n</section>\n<section id=\"prepend-www\">\n<span id=\"std-setting-PREPEND_WWW\"></span><h3><code class=\"docutils literal notranslate\">PREPEND_WWW</code><a class=\"heading-anchor\" href=\"#prepend-www\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h3>\n<p>Default: <code class=\"docutils literal notranslate\">False</code></p>\n<p>Whether to prepend the «www.» subdomain to URLs that don’t have it. This is only\nused if <a class=\"reference internal\" href=\"/it/4.1/ref/middleware/#django.middleware.common.CommonMiddleware\" title=\"django.middleware.common.CommonMiddleware\"><code class=\"xref py py-class docutils literal notranslate\">CommonMiddleware</code></a> is installed\n(see <a class=\"reference internal\" href=\"/it/4.1/topics/http/middleware/\"><span class=\"doc\">Middleware</span></a>). See also <a class=\"reference internal\" href=\"#std-setting-APPEND_SLASH\"><code class=\"xref std std-setting docutils literal notranslate\">APPEND_SLASH</code></a>.</p>\n</section>\n<section id=\"root-urlconf\">\n<span id=\"std-setting-ROOT_URLCONF\"></span><h3><code class=\"docutils literal notranslate\">ROOT_URLCONF</code><a class=\"heading-anchor\" href=\"#root-urlconf\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h3>\n<p>Default: Not defined</p>\n<p>A string representing the full Python import path to your root URLconf, for\nexample <code class=\"docutils literal notranslate\">&quot;mydjangoapps.urls&quot;</code>. Can be overridden on a per-request basis by\nsetting the attribute <code class=\"docutils literal notranslate\">urlconf</code> on the incoming <code class=\"docutils literal notranslate\">HttpRequest</code>\nobject. See <a class=\"reference internal\" href=\"/it/4.1/topics/http/urls/#how-django-processes-a-request\"><span class=\"std std-ref\">How Django processes a request</span></a> for details.</p>\n</section>\n<section id=\"secret-key\">\n<span id=\"std-setting-SECRET_KEY\"></span><h3><code class=\"docutils literal notranslate\">SECRET_KEY</code><a class=\"heading-anchor\" href=\"#secret-key\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h3>\n<p>Default: <code class=\"docutils literal notranslate\">''</code> (Empty string)</p>\n<p>A secret key for a particular Django installation. This is used to provide\n<a class=\"reference internal\" href=\"/it/4.1/topics/signing/\"><span class=\"doc\">cryptographic signing</span></a>, and should be set to a unique,\nunpredictable value.</p>\n<p><a class=\"reference internal\" href=\"/it/4.1/ref/django-admin/#django-admin-startproject\"><code class=\"xref std std-djadmin docutils literal notranslate\">django-admin startproject</code></a> automatically adds a\nrandomly-generated <code class=\"docutils literal notranslate\">SECRET_KEY</code> to each new project.</p>\n<p>Uses of the key shouldn’t assume that it’s text or bytes. Every use should go\nthrough <a class=\"reference internal\" href=\"/it/4.1/ref/utils/#django.utils.encoding.force_str\" title=\"django.utils.encoding.force_str\"><code class=\"xref py py-func docutils literal notranslate\">force_str()</code></a> or\n<a class=\"reference internal\" href=\"/it/4.1/ref/utils/#django.utils.encoding.force_bytes\" title=\"django.utils.encoding.force_bytes\"><code class=\"xref py py-func docutils literal notranslate\">force_bytes()</code></a> to convert it to the desired type.</p>\n<p>Django will refuse to start if <a class=\"reference internal\" href=\"#std-setting-SECRET_KEY\"><code class=\"xref std std-setting docutils literal notranslate\">SECRET_KEY</code></a> is not set.</p>\n<aside class=\"admonition admonition-warning\" role=\"note\">\n<p class=\"admonition-title\">Avvertimento</p>\n<p><strong>Keep this value secret.</strong></p>\n<p>Running Django with a known <a class=\"reference internal\" href=\"#std-setting-SECRET_KEY\"><code class=\"xref std std-setting docutils literal notranslate\">SECRET_KEY</code></a> defeats many of Django’s\nsecurity protections, and can lead to privilege escalation and remote code\nexecution vulnerabilities.</p>\n</aside>\n<p>The secret key is used for:</p>\n<ul class=\"simple\">\n<li><p>All <a class=\"reference internal\" href=\"/it/4.1/topics/http/sessions/\"><span class=\"doc\">sessions</span></a> if you are using\nany other session backend than <code class=\"docutils literal notranslate\">django.contrib.sessions.backends.cache</code>,\nor are using the default\n<a class=\"reference internal\" href=\"/it/4.1/topics/auth/customizing/#django.contrib.auth.models.AbstractBaseUser.get_session_auth_hash\" title=\"django.contrib.auth.models.AbstractBaseUser.get_session_auth_hash\"><code class=\"xref py py-meth docutils literal notranslate\">get_session_auth_hash()</code></a>.</p></li>\n<li><p>All <a class=\"reference internal\" href=\"/it/4.1/ref/contrib/messages/\"><span class=\"doc\">messages</span></a> if you are using\n<a class=\"reference internal\" href=\"/it/4.1/ref/contrib/messages/#django.contrib.messages.storage.cookie.CookieStorage\" title=\"django.contrib.messages.storage.cookie.CookieStorage\"><code class=\"xref py py-class docutils literal notranslate\">CookieStorage</code></a> or\n<a class=\"reference internal\" href=\"/it/4.1/ref/contrib/messages/#django.contrib.messages.storage.fallback.FallbackStorage\" title=\"django.contrib.messages.storage.fallback.FallbackStorage\"><code class=\"xref py py-class docutils literal notranslate\">FallbackStorage</code></a>.</p></li>\n<li><p>All <a class=\"reference internal\" href=\"/it/4.1/topics/auth/default/#django.contrib.auth.views.PasswordResetView\" title=\"django.contrib.auth.views.PasswordResetView\"><code class=\"xref py py-class docutils literal notranslate\">PasswordResetView</code></a> tokens.</p></li>\n<li><p>Any usage of <a class=\"reference internal\" href=\"/it/4.1/topics/signing/\"><span class=\"doc\">cryptographic signing</span></a>, unless a\ndifferent key is provided.</p></li>\n</ul>\n<p>When a secret key is no longer set as <a class=\"reference internal\" href=\"#std-setting-SECRET_KEY\"><code class=\"xref std std-setting docutils literal notranslate\">SECRET_KEY</code></a> or contained within\n<a class=\"reference internal\" href=\"#std-setting-SECRET_KEY_FALLBACKS\"><code class=\"xref std std-setting docutils literal notranslate\">SECRET_KEY_FALLBACKS</code></a> all of the above will be invalidated. When\nrotating your secret key, you should move the old key to\n<a class=\"reference internal\" href=\"#std-setting-SECRET_KEY_FALLBACKS\"><code class=\"xref std std-setting docutils literal notranslate\">SECRET_KEY_FALLBACKS</code></a> temporarily. Secret keys are not used for\npasswords of users and key rotation will not affect them.</p>\n<aside class=\"admonition admonition-note\" role=\"note\">\n<p class=\"admonition-title\">Nota</p>\n<p>The default <code class=\"file docutils literal notranslate\">settings.py</code> file created by <a class=\"reference internal\" href=\"/it/4.1/ref/django-admin/#django-admin-startproject\"><code class=\"xref std std-djadmin docutils literal notranslate\">django-admin\nstartproject</code></a> creates a unique <code class=\"docutils literal notranslate\">SECRET_KEY</code> for\nconvenience.</p>\n</aside>\n</section>\n<section id=\"secret-key-fallbacks\">\n<span id=\"std-setting-SECRET_KEY_FALLBACKS\"></span><h3><code class=\"docutils literal notranslate\">SECRET_KEY_FALLBACKS</code><a class=\"heading-anchor\" href=\"#secret-key-fallbacks\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h3>\n<aside class=\"version-note version-added\" data-version=\"4.1\" role=\"note\">\n<p class=\"version-note-title\">New in Django 4.1</p></aside>\n<p>Default: <code class=\"docutils literal notranslate\">[]</code></p>\n<p>A list of fallback secret keys for a particular Django installation. These are\nused to allow rotation of the <code class=\"docutils literal notranslate\">SECRET_KEY</code>.</p>\n<p>In order to rotate your secret keys, set a new <code class=\"docutils literal notranslate\">SECRET_KEY</code> and move the\nprevious value to the beginning of <code class=\"docutils literal notranslate\">SECRET_KEY_FALLBACKS</code>. Then remove the\nold values from the end of the <code class=\"docutils literal notranslate\">SECRET_KEY_FALLBACKS</code> when you are ready to\nexpire the sessions, password reset tokens, and so on, that make use of them.</p>\n<aside class=\"admonition admonition-note\" role=\"note\">\n<p class=\"admonition-title\">Nota</p>\n<p>Signing operations are computationally expensive. Having multiple old key\nvalues in <code class=\"docutils literal notranslate\">SECRET_KEY_FALLBACKS</code> adds additional overhead to all checks\nthat don’t match an earlier key.</p>\n<p>As such, fallback values should be removed after an appropriate period,\nallowing for key rotation.</p>\n</aside>\n<p>Uses of the secret key values shouldn’t assume that they are text or bytes.\nEvery use should go through <a class=\"reference internal\" href=\"/it/4.1/ref/utils/#django.utils.encoding.force_str\" title=\"django.utils.encoding.force_str\"><code class=\"xref py py-func docutils literal notranslate\">force_str()</code></a> or\n<a class=\"reference internal\" href=\"/it/4.1/ref/utils/#django.utils.encoding.force_bytes\" title=\"django.utils.encoding.force_bytes\"><code class=\"xref py py-func docutils literal notranslate\">force_bytes()</code></a> to convert it to the desired type.</p>\n</section>\n<section id=\"secure-content-type-nosniff\">\n<span id=\"std-setting-SECURE_CONTENT_TYPE_NOSNIFF\"></span><h3><code class=\"docutils literal notranslate\">SECURE_CONTENT_TYPE_NOSNIFF</code><a class=\"heading-anchor\" href=\"#secure-content-type-nosniff\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h3>\n<p>Default: <code class=\"docutils literal notranslate\">True</code></p>\n<p>If <code class=\"docutils literal notranslate\">True</code>, the <a class=\"reference internal\" href=\"/it/4.1/ref/middleware/#django.middleware.security.SecurityMiddleware\" title=\"django.middleware.security.SecurityMiddleware\"><code class=\"xref py py-class docutils literal notranslate\">SecurityMiddleware</code></a>\nsets the <a class=\"reference internal\" href=\"/it/4.1/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\nalready have it.</p>\n</section>\n<section id=\"secure-cross-origin-opener-policy\">\n<span id=\"std-setting-SECURE_CROSS_ORIGIN_OPENER_POLICY\"></span><h3><code class=\"docutils literal notranslate\">SECURE_CROSS_ORIGIN_OPENER_POLICY</code><a class=\"heading-anchor\" href=\"#secure-cross-origin-opener-policy\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h3>\n<aside class=\"version-note version-added\" data-version=\"4.0\" role=\"note\">\n<p class=\"version-note-title\">New in Django 4.0</p></aside>\n<p>Default: <code class=\"docutils literal notranslate\">'same-origin'</code></p>\n<p>Unless set to <code class=\"docutils literal notranslate\">None</code>, the\n<a class=\"reference internal\" href=\"/it/4.1/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=\"/it/4.1/ref/middleware/#cross-origin-opener-policy\"><span class=\"std std-ref\">Cross-Origin Opener Policy</span></a> header on all responses that do not already\nhave it to the value provided.</p>\n</section>\n<section id=\"secure-hsts-include-subdomains\">\n<span id=\"std-setting-SECURE_HSTS_INCLUDE_SUBDOMAINS\"></span><h3><code class=\"docutils literal notranslate\">SECURE_HSTS_INCLUDE_SUBDOMAINS</code><a class=\"heading-anchor\" href=\"#secure-hsts-include-subdomains\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h3>\n<p>Default: <code class=\"docutils literal notranslate\">False</code></p>\n<p>If <code class=\"docutils literal notranslate\">True</code>, the <a class=\"reference internal\" href=\"/it/4.1/ref/middleware/#django.middleware.security.SecurityMiddleware\" title=\"django.middleware.security.SecurityMiddleware\"><code class=\"xref py py-class docutils literal notranslate\">SecurityMiddleware</code></a> adds\nthe <code class=\"docutils literal notranslate\">includeSubDomains</code> directive to the <a class=\"reference internal\" href=\"/it/4.1/ref/middleware/#http-strict-transport-security\"><span class=\"std std-ref\">HTTP Strict Transport Security</span></a>\nheader. It has no effect unless <a class=\"reference internal\" href=\"#std-setting-SECURE_HSTS_SECONDS\"><code class=\"xref std std-setting docutils literal notranslate\">SECURE_HSTS_SECONDS</code></a> is set to a\nnon-zero value.</p>\n<aside class=\"admonition admonition-warning\" role=\"note\">\n<p class=\"admonition-title\">Avvertimento</p>\n<p>Setting this incorrectly can irreversibly (for the value of\n<a class=\"reference internal\" href=\"#std-setting-SECURE_HSTS_SECONDS\"><code class=\"xref std std-setting docutils literal notranslate\">SECURE_HSTS_SECONDS</code></a>) break your site. Read the\n<a class=\"reference internal\" href=\"/it/4.1/ref/middleware/#http-strict-transport-security\"><span class=\"std std-ref\">HTTP Strict Transport Security</span></a> documentation first.</p>\n</aside>\n</section>\n<section id=\"secure-hsts-preload\">\n<span id=\"std-setting-SECURE_HSTS_PRELOAD\"></span><h3><code class=\"docutils literal notranslate\">SECURE_HSTS_PRELOAD</code><a class=\"heading-anchor\" href=\"#secure-hsts-preload\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h3>\n<p>Default: <code class=\"docutils literal notranslate\">False</code></p>\n<p>If <code class=\"docutils literal notranslate\">True</code>, the <a class=\"reference internal\" href=\"/it/4.1/ref/middleware/#django.middleware.security.SecurityMiddleware\" title=\"django.middleware.security.SecurityMiddleware\"><code class=\"xref py py-class docutils literal notranslate\">SecurityMiddleware</code></a> adds\nthe <code class=\"docutils literal notranslate\">preload</code> directive to the <a class=\"reference internal\" href=\"/it/4.1/ref/middleware/#http-strict-transport-security\"><span class=\"std std-ref\">HTTP Strict Transport Security</span></a>\nheader. It has no effect unless <a class=\"reference internal\" href=\"#std-setting-SECURE_HSTS_SECONDS\"><code class=\"xref std std-setting docutils literal notranslate\">SECURE_HSTS_SECONDS</code></a> is set to a\nnon-zero value.</p>\n</section>\n<section id=\"secure-hsts-seconds\">\n<span id=\"std-setting-SECURE_HSTS_SECONDS\"></span><h3><code class=\"docutils literal notranslate\">SECURE_HSTS_SECONDS</code><a class=\"heading-anchor\" href=\"#secure-hsts-seconds\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h3>\n<p>Default: <code class=\"docutils literal notranslate\">0</code></p>\n<p>If set to a non-zero integer value, the\n<a class=\"reference internal\" href=\"/it/4.1/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=\"/it/4.1/ref/middleware/#http-strict-transport-security\"><span class=\"std std-ref\">HTTP Strict Transport Security</span></a> header on all responses that do not\nalready have it.</p>\n<aside class=\"admonition admonition-warning\" role=\"note\">\n<p class=\"admonition-title\">Avvertimento</p>\n<p>Setting this incorrectly can irreversibly (for some time) break your site.\nRead the <a class=\"reference internal\" href=\"/it/4.1/ref/middleware/#http-strict-transport-security\"><span class=\"std std-ref\">HTTP Strict Transport Security</span></a> documentation first.</p>\n</aside>\n</section>\n<section id=\"secure-proxy-ssl-header\">\n<span id=\"std-setting-SECURE_PROXY_SSL_HEADER\"></span><h3><code class=\"docutils literal notranslate\">SECURE_PROXY_SSL_HEADER</code><a class=\"heading-anchor\" href=\"#secure-proxy-ssl-header\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h3>\n<p>Default: <code class=\"docutils literal notranslate\">None</code></p>\n<p>A tuple representing an HTTP header/value combination that signifies a request\nis secure. This controls the behavior of the request object’s <code class=\"docutils literal notranslate\">is_secure()</code>\nmethod.</p>\n<p>By default, <code class=\"docutils literal notranslate\">is_secure()</code> determines if a request is secure by confirming\nthat a requested URL uses <code class=\"docutils literal notranslate\">https://</code>. This method is important for Django’s\nCSRF protection, and it may be used by your own code or third-party apps.</p>\n<p>If your Django app is behind a proxy, though, the proxy may be «swallowing»\nwhether the original request uses HTTPS or not. If there is a non-HTTPS\nconnection between the proxy and Django then <code class=\"docutils literal notranslate\">is_secure()</code> would always\nreturn <code class=\"docutils literal notranslate\">False</code> – even for requests that were made via HTTPS by the end user.\nIn contrast, if there is an HTTPS connection between the proxy and Django then\n<code class=\"docutils literal notranslate\">is_secure()</code> would always return <code class=\"docutils literal notranslate\">True</code> – even for requests that were\nmade originally via HTTP.</p>\n<p>In this situation, configure your proxy to set a custom HTTP header that tells\nDjango whether the request came in via HTTPS, and set\n<code class=\"docutils literal notranslate\">SECURE_PROXY_SSL_HEADER</code> so that Django knows what header to look for.</p>\n<p>Set a tuple with two elements – the name of the header to look for and the\nrequired value. For example:</p>\n<div class=\"code-block\" data-language=\"default\"><div class=\"code-block-toolbar\"><span class=\"code-block-language\">Code</span><button type=\"button\" class=\"copy-button\" data-copy hidden><span class=\"copy-button-label\">Copy</span></button></div><pre role=\"group\" tabindex=\"0\" aria-label=\"Code code\"><code>SECURE_PROXY_SSL_HEADER <span class=\"o\">=</span> <span class=\"p\">(</span><span class=\"s1\">&#39;HTTP_X_FORWARDED_PROTO&#39;</span><span class=\"p\">,</span> <span class=\"s1\">&#39;https&#39;</span><span class=\"p\">)</span>\n</code></pre></div>\n<p>This tells Django to trust the <code class=\"docutils literal notranslate\">X-Forwarded-Proto</code> header that comes from our\nproxy and that the request is guaranteed to be secure (i.e., it originally came\nin via HTTPS) when:</p>\n<ul class=\"simple\">\n<li><p>the header value is <code class=\"docutils literal notranslate\">'https'</code>, or</p></li>\n<li><p>its initial, leftmost value is <code class=\"docutils literal notranslate\">'https'</code> in the case of a comma-separated\nlist of protocols (e.g. <code class=\"docutils literal notranslate\">'https,http,http'</code>).</p></li>\n</ul>\n<aside class=\"version-note version-changed\" data-version=\"4.1\" role=\"note\">\n<p class=\"version-note-title\">Changed in Django 4.1</p><p>Support for a comma-separated list of protocols in the header value was\nadded.</p>\n</aside>\n<p>You should <em>only</em> set this setting if you control your proxy or have some other\nguarantee that it sets/strips this header appropriately.</p>\n<p>Note that the header needs to be in the format as used by <code class=\"docutils literal notranslate\">request.META</code> –\nall caps and likely starting with <code class=\"docutils literal notranslate\">HTTP_</code>. (Remember, Django automatically\nadds <code class=\"docutils literal notranslate\">'HTTP_'</code> to the start of x-header names before making the header\navailable in <code class=\"docutils literal notranslate\">request.META</code>.)</p>\n<aside class=\"admonition admonition-warning\" role=\"note\">\n<p class=\"admonition-title\">Avvertimento</p>\n<p><strong>Modifying this setting can compromise your site’s security. Ensure you\nfully understand your setup before changing it.</strong></p>\n<p>Make sure ALL of the following are true before setting this (assuming the\nvalues from the example above):</p>\n<ul class=\"simple\">\n<li><p>Your Django app is behind a proxy.</p></li>\n<li><p>Your proxy strips the <code class=\"docutils literal notranslate\">X-Forwarded-Proto</code> header from all incoming\nrequests, even when it contains a comma-separated list of protocols. In\nother words, if end users include that header in their requests, the\nproxy will discard it.</p></li>\n<li><p>Your proxy sets the <code class=\"docutils literal notranslate\">X-Forwarded-Proto</code> header and sends it to Django,\nbut only for requests that originally come in via HTTPS.</p></li>\n</ul>\n<p>If any of those are not true, you should keep this setting set to <code class=\"docutils literal notranslate\">None</code>\nand find another way of determining HTTPS, perhaps via custom middleware.</p>\n</aside>\n</section>\n<section id=\"secure-redirect-exempt\">\n<span id=\"std-setting-SECURE_REDIRECT_EXEMPT\"></span><h3><code class=\"docutils literal notranslate\">SECURE_REDIRECT_EXEMPT</code><a class=\"heading-anchor\" href=\"#secure-redirect-exempt\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h3>\n<p>Default: <code class=\"docutils literal notranslate\">[]</code> (Empty list)</p>\n<p>If a URL path matches a regular expression in this list, the request will not be\nredirected to HTTPS. The\n<a class=\"reference internal\" href=\"/it/4.1/ref/middleware/#django.middleware.security.SecurityMiddleware\" title=\"django.middleware.security.SecurityMiddleware\"><code class=\"xref py py-class docutils literal notranslate\">SecurityMiddleware</code></a> strips leading slashes\nfrom URL paths, so patterns shouldn’t include them, e.g.\n<code class=\"docutils literal notranslate\">SECURE_REDIRECT_EXEMPT = [r'^no-ssl/$', …]</code>. If\n<a class=\"reference internal\" href=\"#std-setting-SECURE_SSL_REDIRECT\"><code class=\"xref std std-setting docutils literal notranslate\">SECURE_SSL_REDIRECT</code></a> is <code class=\"docutils literal notranslate\">False</code>, this setting has no effect.</p>\n</section>\n<section id=\"secure-referrer-policy\">\n<span id=\"std-setting-SECURE_REFERRER_POLICY\"></span><h3><code class=\"docutils literal notranslate\">SECURE_REFERRER_POLICY</code><a class=\"heading-anchor\" href=\"#secure-referrer-policy\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h3>\n<p>Default: <code class=\"docutils literal notranslate\">'same-origin'</code></p>\n<p>If configured, the <a class=\"reference internal\" href=\"/it/4.1/ref/middleware/#django.middleware.security.SecurityMiddleware\" title=\"django.middleware.security.SecurityMiddleware\"><code class=\"xref py py-class docutils literal notranslate\">SecurityMiddleware</code></a> sets\nthe <a class=\"reference internal\" href=\"/it/4.1/ref/middleware/#referrer-policy\"><span class=\"std std-ref\">Referrer Policy</span></a> header on all responses that do not already have it\nto the value provided.</p>\n</section>\n<section id=\"secure-ssl-host\">\n<span id=\"std-setting-SECURE_SSL_HOST\"></span><h3><code class=\"docutils literal notranslate\">SECURE_SSL_HOST</code><a class=\"heading-anchor\" href=\"#secure-ssl-host\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h3>\n<p>Default: <code class=\"docutils literal notranslate\">None</code></p>\n<p>If a string (e.g. <code class=\"docutils literal notranslate\">secure.example.com</code>), all SSL redirects will be directed\nto this host rather than the originally-requested host\n(e.g. <code class=\"docutils literal notranslate\">www.example.com</code>). If <a class=\"reference internal\" href=\"#std-setting-SECURE_SSL_REDIRECT\"><code class=\"xref std std-setting docutils literal notranslate\">SECURE_SSL_REDIRECT</code></a> is <code class=\"docutils literal notranslate\">False</code>, this\nsetting has no effect.</p>\n</section>\n<section id=\"secure-ssl-redirect\">\n<span id=\"std-setting-SECURE_SSL_REDIRECT\"></span><h3><code class=\"docutils literal notranslate\">SECURE_SSL_REDIRECT</code><a class=\"heading-anchor\" href=\"#secure-ssl-redirect\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h3>\n<p>Default: <code class=\"docutils literal notranslate\">False</code></p>\n<p>If <code class=\"docutils literal notranslate\">True</code>, the <a class=\"reference internal\" href=\"/it/4.1/ref/middleware/#django.middleware.security.SecurityMiddleware\" title=\"django.middleware.security.SecurityMiddleware\"><code class=\"xref py py-class docutils literal notranslate\">SecurityMiddleware</code></a>\n<a class=\"reference internal\" href=\"/it/4.1/ref/middleware/#ssl-redirect\"><span class=\"std std-ref\">redirects</span></a> all non-HTTPS requests to HTTPS (except for\nthose URLs matching a regular expression listed in\n<a class=\"reference internal\" href=\"#std-setting-SECURE_REDIRECT_EXEMPT\"><code class=\"xref std std-setting docutils literal notranslate\">SECURE_REDIRECT_EXEMPT</code></a>).</p>\n<aside class=\"admonition admonition-note\" role=\"note\">\n<p class=\"admonition-title\">Nota</p>\n<p>If turning this to <code class=\"docutils literal notranslate\">True</code> causes infinite redirects, it probably means\nyour site is running behind a proxy and can’t tell which requests are secure\nand which are not. Your proxy likely sets a header to indicate secure\nrequests; you can correct the problem by finding out what that header is and\nconfiguring the <a class=\"reference internal\" href=\"#std-setting-SECURE_PROXY_SSL_HEADER\"><code class=\"xref std std-setting docutils literal notranslate\">SECURE_PROXY_SSL_HEADER</code></a> setting accordingly.</p>\n</aside>\n</section>\n<section id=\"serialization-modules\">\n<span id=\"std-setting-SERIALIZATION_MODULES\"></span><h3><code class=\"docutils literal notranslate\">SERIALIZATION_MODULES</code><a class=\"heading-anchor\" href=\"#serialization-modules\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h3>\n<p>Default: Not defined</p>\n<p>A dictionary of modules containing serializer definitions (provided as\nstrings), keyed by a string identifier for that serialization type. For\nexample, to define a YAML serializer, use:</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>SERIALIZATION_MODULES <span class=\"o\">=</span> <span class=\"p\">{</span><span class=\"s1\">&#39;yaml&#39;</span><span class=\"p\">:</span> <span class=\"s1\">&#39;path.to.yaml_serializer&#39;</span><span class=\"p\">}</span>\n</code></pre></div>\n</section>\n<section id=\"server-email\">\n<span id=\"std-setting-SERVER_EMAIL\"></span><h3><code class=\"docutils literal notranslate\">SERVER_EMAIL</code><a class=\"heading-anchor\" href=\"#server-email\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h3>\n<p>Default: <code class=\"docutils literal notranslate\">'root&#64;localhost'</code></p>\n<p>The email address that error messages come from, such as those sent to\n<a class=\"reference internal\" href=\"#std-setting-ADMINS\"><code class=\"xref std std-setting docutils literal notranslate\">ADMINS</code></a> and <a class=\"reference internal\" href=\"#std-setting-MANAGERS\"><code class=\"xref std std-setting docutils literal notranslate\">MANAGERS</code></a>.</p>\n<aside class=\"admonition-why-are-my-emails-sent-from-a-different-address admonition\" role=\"note\">\n<p class=\"admonition-title\">Why are my emails sent from a different address?</p>\n<p>This address is used only for error messages. It is <em>not</em> the address that\nregular email messages sent with <a class=\"reference internal\" href=\"/it/4.1/topics/email/#django.core.mail.send_mail\" title=\"django.core.mail.send_mail\"><code class=\"xref py py-meth docutils literal notranslate\">send_mail()</code></a>\ncome from; for that, see <a class=\"reference internal\" href=\"#std-setting-DEFAULT_FROM_EMAIL\"><code class=\"xref std std-setting docutils literal notranslate\">DEFAULT_FROM_EMAIL</code></a>.</p>\n</aside>\n</section>\n<section id=\"short-date-format\">\n<span id=\"std-setting-SHORT_DATE_FORMAT\"></span><h3><code class=\"docutils literal notranslate\">SHORT_DATE_FORMAT</code><a class=\"heading-anchor\" href=\"#short-date-format\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h3>\n<p>Default: <code class=\"docutils literal notranslate\">'m/d/Y'</code> (e.g. <code class=\"docutils literal notranslate\">12/31/2003</code>)</p>\n<p>An available formatting that can be used for displaying date fields on\ntemplates. Note that if <a class=\"reference internal\" href=\"#std-setting-USE_L10N\"><code class=\"xref std std-setting docutils literal notranslate\">USE_L10N</code></a> is set to <code class=\"docutils literal notranslate\">True</code>, then the\ncorresponding locale-dictated format has higher precedence and will be applied.\nSee <a class=\"reference internal\" href=\"/it/4.1/ref/templates/builtins/#std-templatefilter-date\"><code class=\"xref std std-tfilter docutils literal notranslate\">allowed date format strings</code></a>.</p>\n<p>See also <a class=\"reference internal\" href=\"#std-setting-DATE_FORMAT\"><code class=\"xref std std-setting docutils literal notranslate\">DATE_FORMAT</code></a> and <a class=\"reference internal\" href=\"#std-setting-SHORT_DATETIME_FORMAT\"><code class=\"xref std std-setting docutils literal notranslate\">SHORT_DATETIME_FORMAT</code></a>.</p>\n</section>\n<section id=\"short-datetime-format\">\n<span id=\"std-setting-SHORT_DATETIME_FORMAT\"></span><h3><code class=\"docutils literal notranslate\">SHORT_DATETIME_FORMAT</code><a class=\"heading-anchor\" href=\"#short-datetime-format\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h3>\n<p>Default: <code class=\"docutils literal notranslate\">'m/d/Y P'</code> (e.g. <code class=\"docutils literal notranslate\">12/31/2003 4 p.m.</code>)</p>\n<p>An available formatting that can be used for displaying datetime fields on\ntemplates. Note that if <a class=\"reference internal\" href=\"#std-setting-USE_L10N\"><code class=\"xref std std-setting docutils literal notranslate\">USE_L10N</code></a> is set to <code class=\"docutils literal notranslate\">True</code>, then the\ncorresponding locale-dictated format has higher precedence and will be applied.\nSee <a class=\"reference internal\" href=\"/it/4.1/ref/templates/builtins/#std-templatefilter-date\"><code class=\"xref std std-tfilter docutils literal notranslate\">allowed date format strings</code></a>.</p>\n<p>See also <a class=\"reference internal\" href=\"#std-setting-DATE_FORMAT\"><code class=\"xref std std-setting docutils literal notranslate\">DATE_FORMAT</code></a> and <a class=\"reference internal\" href=\"#std-setting-SHORT_DATE_FORMAT\"><code class=\"xref std std-setting docutils literal notranslate\">SHORT_DATE_FORMAT</code></a>.</p>\n</section>\n<section id=\"signing-backend\">\n<span id=\"std-setting-SIGNING_BACKEND\"></span><h3><code class=\"docutils literal notranslate\">SIGNING_BACKEND</code><a class=\"heading-anchor\" href=\"#signing-backend\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h3>\n<p>Default: <code class=\"docutils literal notranslate\">'django.core.signing.TimestampSigner'</code></p>\n<p>The backend used for signing cookies and other data.</p>\n<p>See also the <a class=\"reference internal\" href=\"/it/4.1/topics/signing/\"><span class=\"doc\">Cryptographic signing</span></a> documentation.</p>\n</section>\n<section id=\"silenced-system-checks\">\n<span id=\"std-setting-SILENCED_SYSTEM_CHECKS\"></span><h3><code class=\"docutils literal notranslate\">SILENCED_SYSTEM_CHECKS</code><a class=\"heading-anchor\" href=\"#silenced-system-checks\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h3>\n<p>Default: <code class=\"docutils literal notranslate\">[]</code> (Empty list)</p>\n<p>A list of identifiers of messages generated by the system check framework\n(i.e. <code class=\"docutils literal notranslate\">[&quot;models.W001&quot;]</code>) that you wish to permanently acknowledge and ignore.\nSilenced checks will not be output to the console.</p>\n<p>See also the <a class=\"reference internal\" href=\"/it/4.1/ref/checks/\"><span class=\"doc\">System check framework</span></a> documentation.</p>\n</section>\n<section id=\"templates\">\n<span id=\"std-setting-TEMPLATES\"></span><h3><code class=\"docutils literal notranslate\">TEMPLATES</code><a class=\"heading-anchor\" href=\"#templates\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h3>\n<p>Default: <code class=\"docutils literal notranslate\">[]</code> (Empty list)</p>\n<p>A list containing the settings for all template engines to be used with\nDjango. Each item of the list is a dictionary containing the options for an\nindividual engine.</p>\n<p>Here’s a setup that tells the Django template engine to load templates from the\n<code class=\"docutils literal notranslate\">templates</code> subdirectory inside each installed application:</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>TEMPLATES <span class=\"o\">=</span> <span class=\"p\">[</span>\n    <span class=\"p\">{</span>\n        <span class=\"s1\">&#39;BACKEND&#39;</span><span class=\"p\">:</span> <span class=\"s1\">&#39;django.template.backends.django.DjangoTemplates&#39;</span><span class=\"p\">,</span>\n        <span class=\"s1\">&#39;APP_DIRS&#39;</span><span class=\"p\">:</span> <span class=\"kc\">True</span><span class=\"p\">,</span>\n    <span class=\"p\">},</span>\n<span class=\"p\">]</span>\n</code></pre></div>\n<p>The following options are available for all backends.</p>\n<section id=\"std-setting-TEMPLATES-BACKEND\">\n<span id=\"id6\"></span><h4><code class=\"docutils literal notranslate\">BACKEND</code><a class=\"heading-anchor\" href=\"#std-setting-TEMPLATES-BACKEND\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h4>\n<p>Default: Not defined</p>\n<p>The template backend to use. The built-in template backends are:</p>\n<ul class=\"simple\">\n<li><p><code class=\"docutils literal notranslate\">'django.template.backends.django.DjangoTemplates'</code></p></li>\n<li><p><code class=\"docutils literal notranslate\">'django.template.backends.jinja2.Jinja2'</code></p></li>\n</ul>\n<p>You can use a template backend that doesn’t ship with Django by setting\n<code class=\"docutils literal notranslate\">BACKEND</code> to a fully-qualified path (i.e. <code class=\"docutils literal notranslate\">'mypackage.whatever.Backend'</code>).</p>\n</section>\n<section id=\"std-setting-TEMPLATES-NAME\">\n<span id=\"id7\"></span><h4><code class=\"docutils literal notranslate\">NAME</code><a class=\"heading-anchor\" href=\"#std-setting-TEMPLATES-NAME\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h4>\n<p>Default: see below</p>\n<p>The alias for this particular template engine. It’s an identifier that allows\nselecting an engine for rendering. Aliases must be unique across all\nconfigured template engines.</p>\n<p>It defaults to the name of the module defining the engine class, i.e. the\nnext to last piece of <a class=\"reference internal\" href=\"#std-setting-TEMPLATES-BACKEND\"><code class=\"xref std std-setting docutils literal notranslate\">BACKEND</code></a>, when it isn’t\nprovided. For example if the backend is <code class=\"docutils literal notranslate\">'mypackage.whatever.Backend'</code> then\nits default name is <code class=\"docutils literal notranslate\">'whatever'</code>.</p>\n</section>\n<section id=\"dirs\">\n<span id=\"std-setting-TEMPLATES-DIRS\"></span><h4><code class=\"docutils literal notranslate\">DIRS</code><a class=\"heading-anchor\" href=\"#dirs\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h4>\n<p>Default: <code class=\"docutils literal notranslate\">[]</code> (Empty list)</p>\n<p>Directories where the engine should look for template source files, in search\norder.</p>\n</section>\n<section id=\"app-dirs\">\n<span id=\"std-setting-TEMPLATES-APP_DIRS\"></span><h4><code class=\"docutils literal notranslate\">APP_DIRS</code><a class=\"heading-anchor\" href=\"#app-dirs\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h4>\n<p>Default: <code class=\"docutils literal notranslate\">False</code></p>\n<p>Whether the engine should look for template source files inside installed\napplications.</p>\n<aside class=\"admonition admonition-note\" role=\"note\">\n<p class=\"admonition-title\">Nota</p>\n<p>The default <code class=\"file docutils literal notranslate\">settings.py</code> file created by <a class=\"reference internal\" href=\"/it/4.1/ref/django-admin/#django-admin-startproject\"><code class=\"xref std std-djadmin docutils literal notranslate\">django-admin\nstartproject</code></a> sets <code class=\"docutils literal notranslate\">'APP_DIRS': True</code>.</p>\n</aside>\n</section>\n<section id=\"std-setting-TEMPLATES-OPTIONS\">\n<span id=\"id8\"></span><h4><code class=\"docutils literal notranslate\">OPTIONS</code><a class=\"heading-anchor\" href=\"#std-setting-TEMPLATES-OPTIONS\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h4>\n<p>Default: <code class=\"docutils literal notranslate\">{}</code> (Empty dict)</p>\n<p>Extra parameters to pass to the template backend. Available parameters vary\ndepending on the template backend. See\n<a class=\"reference internal\" href=\"/it/4.1/topics/templates/#django.template.backends.django.DjangoTemplates\" title=\"django.template.backends.django.DjangoTemplates\"><code class=\"xref py py-class docutils literal notranslate\">DjangoTemplates</code></a> and\n<a class=\"reference internal\" href=\"/it/4.1/topics/templates/#django.template.backends.jinja2.Jinja2\" title=\"django.template.backends.jinja2.Jinja2\"><code class=\"xref py py-class docutils literal notranslate\">Jinja2</code></a> for the options of the\nbuilt-in backends.</p>\n</section>\n</section>\n<section id=\"test-runner\">\n<span id=\"std-setting-TEST_RUNNER\"></span><h3><code class=\"docutils literal notranslate\">TEST_RUNNER</code><a class=\"heading-anchor\" href=\"#test-runner\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h3>\n<p>Default: <code class=\"docutils literal notranslate\">'django.test.runner.DiscoverRunner'</code></p>\n<p>The name of the class to use for starting the test suite. See\n<a class=\"reference internal\" href=\"/it/4.1/topics/testing/advanced/#other-testing-frameworks\"><span class=\"std std-ref\">Using different testing frameworks</span></a>.</p>\n</section>\n<section id=\"test-non-serialized-apps\">\n<span id=\"std-setting-TEST_NON_SERIALIZED_APPS\"></span><h3><code class=\"docutils literal notranslate\">TEST_NON_SERIALIZED_APPS</code><a class=\"heading-anchor\" href=\"#test-non-serialized-apps\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h3>\n<p>Default: <code class=\"docutils literal notranslate\">[]</code> (Empty list)</p>\n<p>In order to restore the database state between tests for\n<code class=\"docutils literal notranslate\">TransactionTestCase</code>s and database backends without transactions, Django\nwill <a class=\"reference internal\" href=\"/it/4.1/topics/testing/overview/#test-case-serialized-rollback\"><span class=\"std std-ref\">serialize the contents of all apps</span></a>\nwhen it starts the test run so it can then reload from that copy before running\ntests that need it.</p>\n<p>This slows down the startup time of the test runner; if you have apps that\nyou know don’t need this feature, you can add their full names in here (e.g.\n<code class=\"docutils literal notranslate\">'django.contrib.contenttypes'</code>) to exclude them from this serialization\nprocess.</p>\n</section>\n<section id=\"thousand-separator\">\n<span id=\"std-setting-THOUSAND_SEPARATOR\"></span><h3><code class=\"docutils literal notranslate\">THOUSAND_SEPARATOR</code><a class=\"heading-anchor\" href=\"#thousand-separator\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h3>\n<p>Default: <code class=\"docutils literal notranslate\">','</code> (Comma)</p>\n<p>Default thousand separator used when formatting numbers. This setting is\nused only when <a class=\"reference internal\" href=\"#std-setting-USE_THOUSAND_SEPARATOR\"><code class=\"xref std std-setting docutils literal notranslate\">USE_THOUSAND_SEPARATOR</code></a> is <code class=\"docutils literal notranslate\">True</code> and\n<a class=\"reference internal\" href=\"#std-setting-NUMBER_GROUPING\"><code class=\"xref std std-setting docutils literal notranslate\">NUMBER_GROUPING</code></a> is greater than <code class=\"docutils literal notranslate\">0</code>.</p>\n<p>Note that if <a class=\"reference internal\" href=\"#std-setting-USE_L10N\"><code class=\"xref std std-setting docutils literal notranslate\">USE_L10N</code></a> is set to <code class=\"docutils literal notranslate\">True</code>, then the locale-dictated\nformat has higher precedence and will be applied instead.</p>\n<p>See also <a class=\"reference internal\" href=\"#std-setting-NUMBER_GROUPING\"><code class=\"xref std std-setting docutils literal notranslate\">NUMBER_GROUPING</code></a>, <a class=\"reference internal\" href=\"#std-setting-DECIMAL_SEPARATOR\"><code class=\"xref std std-setting docutils literal notranslate\">DECIMAL_SEPARATOR</code></a> and\n<a class=\"reference internal\" href=\"#std-setting-USE_THOUSAND_SEPARATOR\"><code class=\"xref std std-setting docutils literal notranslate\">USE_THOUSAND_SEPARATOR</code></a>.</p>\n</section>\n<section id=\"time-format\">\n<span id=\"std-setting-TIME_FORMAT\"></span><h3><code class=\"docutils literal notranslate\">TIME_FORMAT</code><a class=\"heading-anchor\" href=\"#time-format\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h3>\n<p>Default: <code class=\"docutils literal notranslate\">'P'</code> (e.g. <code class=\"docutils literal notranslate\">4 p.m.</code>)</p>\n<p>The default formatting to use for displaying time fields in any part of the\nsystem. Note that if <a class=\"reference internal\" href=\"#std-setting-USE_L10N\"><code class=\"xref std std-setting docutils literal notranslate\">USE_L10N</code></a> is set to <code class=\"docutils literal notranslate\">True</code>, then the\nlocale-dictated format has higher precedence and will be applied instead. See\n<a class=\"reference internal\" href=\"/it/4.1/ref/templates/builtins/#std-templatefilter-date\"><code class=\"xref std std-tfilter docutils literal notranslate\">allowed date format strings</code></a>.</p>\n<p>See also <a class=\"reference internal\" href=\"#std-setting-DATE_FORMAT\"><code class=\"xref std std-setting docutils literal notranslate\">DATE_FORMAT</code></a> and <a class=\"reference internal\" href=\"#std-setting-DATETIME_FORMAT\"><code class=\"xref std std-setting docutils literal notranslate\">DATETIME_FORMAT</code></a>.</p>\n</section>\n<section id=\"time-input-formats\">\n<span id=\"std-setting-TIME_INPUT_FORMATS\"></span><h3><code class=\"docutils literal notranslate\">TIME_INPUT_FORMATS</code><a class=\"heading-anchor\" href=\"#time-input-formats\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h3>\n<p>Default:</p>\n<div class=\"code-block\" data-language=\"default\"><div class=\"code-block-toolbar\"><span class=\"code-block-language\">Code</span><button type=\"button\" class=\"copy-button\" data-copy hidden><span class=\"copy-button-label\">Copy</span></button></div><pre role=\"group\" tabindex=\"0\" aria-label=\"Code code\"><code><span class=\"p\">[</span>\n    <span class=\"s1\">&#39;%H:%M:%S&#39;</span><span class=\"p\">,</span>     <span class=\"c1\"># &#39;14:30:59&#39;</span>\n    <span class=\"s1\">&#39;%H:%M:%S.</span><span class=\"si\">%f</span><span class=\"s1\">&#39;</span><span class=\"p\">,</span>  <span class=\"c1\"># &#39;14:30:59.000200&#39;</span>\n    <span class=\"s1\">&#39;%H:%M&#39;</span><span class=\"p\">,</span>        <span class=\"c1\"># &#39;14:30&#39;</span>\n<span class=\"p\">]</span>\n</code></pre></div>\n<p>A list of formats that will be accepted when inputting data on a time field.\nFormats will be tried in order, using the first valid one. Note that these\nformat strings use Python’s <a class=\"reference external\" href=\"https://docs.python.org/3/library/datetime.html#strftime-strptime-behavior\" title=\"(in Python v3.14)\"><span class=\"xref std std-ref\">datetime module syntax</span></a>, not the format strings from the <a class=\"reference internal\" href=\"/it/4.1/ref/templates/builtins/#std-templatefilter-date\"><code class=\"xref std std-tfilter docutils literal notranslate\">date</code></a>\ntemplate filter.</p>\n<p>When <a class=\"reference internal\" href=\"#std-setting-USE_L10N\"><code class=\"xref std std-setting docutils literal notranslate\">USE_L10N</code></a> is <code class=\"docutils literal notranslate\">True</code>, the locale-dictated format has higher\nprecedence and will be applied instead.</p>\n<p>See also <a class=\"reference internal\" href=\"#std-setting-DATE_INPUT_FORMATS\"><code class=\"xref std std-setting docutils literal notranslate\">DATE_INPUT_FORMATS</code></a> and <a class=\"reference internal\" href=\"#std-setting-DATETIME_INPUT_FORMATS\"><code class=\"xref std std-setting docutils literal notranslate\">DATETIME_INPUT_FORMATS</code></a>.</p>\n</section>\n<section id=\"std-setting-TIME_ZONE\">\n<span id=\"id9\"></span><h3><code class=\"docutils literal notranslate\">TIME_ZONE</code><a class=\"heading-anchor\" href=\"#std-setting-TIME_ZONE\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h3>\n<p>Default: <code class=\"docutils literal notranslate\">'America/Chicago'</code></p>\n<p>A string representing the time zone for this installation. See the <a class=\"reference external\" href=\"https://en.wikipedia.org/wiki/List_of_tz_database_time_zones\">list of\ntime zones</a>.</p>\n<aside class=\"admonition admonition-note\" role=\"note\">\n<p class=\"admonition-title\">Nota</p>\n<p>Since Django was first released with the <a class=\"reference internal\" href=\"#std-setting-TIME_ZONE\"><code class=\"xref std std-setting docutils literal notranslate\">TIME_ZONE</code></a> set to\n<code class=\"docutils literal notranslate\">'America/Chicago'</code>, the global setting (used if nothing is defined in\nyour project’s <code class=\"docutils literal notranslate\">settings.py</code>) remains <code class=\"docutils literal notranslate\">'America/Chicago'</code> for backwards\ncompatibility. New project templates default to <code class=\"docutils literal notranslate\">'UTC'</code>.</p>\n</aside>\n<p>Note that this isn’t necessarily the time zone of the server. For example, one\nserver may serve multiple Django-powered sites, each with a separate time zone\nsetting.</p>\n<p>When <a class=\"reference internal\" href=\"#std-setting-USE_TZ\"><code class=\"xref std std-setting docutils literal notranslate\">USE_TZ</code></a> is <code class=\"docutils literal notranslate\">False</code>, this is the time zone in which Django\nwill store all datetimes. When <a class=\"reference internal\" href=\"#std-setting-USE_TZ\"><code class=\"xref std std-setting docutils literal notranslate\">USE_TZ</code></a> is <code class=\"docutils literal notranslate\">True</code>, this is the\ndefault time zone that Django will use to display datetimes in templates and\nto interpret datetimes entered in forms.</p>\n<p>On Unix environments (where <a class=\"reference external\" href=\"https://docs.python.org/3/library/time.html#time.tzset\" title=\"(in Python v3.14)\"><code class=\"xref py py-func docutils literal notranslate\">time.tzset()</code></a> is implemented), Django sets the\n<code class=\"docutils literal notranslate\">os.environ['TZ']</code> variable to the time zone you specify in the\n<a class=\"reference internal\" href=\"#std-setting-TIME_ZONE\"><code class=\"xref std std-setting docutils literal notranslate\">TIME_ZONE</code></a> setting. Thus, all your views and models will\nautomatically operate in this time zone. However, Django won’t set the <code class=\"docutils literal notranslate\">TZ</code>\nenvironment variable if you’re using the manual configuration option as\ndescribed in <a class=\"reference internal\" href=\"/it/4.1/topics/settings/#settings-without-django-settings-module\"><span class=\"std std-ref\">manually configuring settings</span></a>. If Django doesn’t set the <code class=\"docutils literal notranslate\">TZ</code>\nenvironment variable, it’s up to you to ensure your processes are running in\nthe correct environment.</p>\n<aside class=\"admonition admonition-note\" role=\"note\">\n<p class=\"admonition-title\">Nota</p>\n<p>Django cannot reliably use alternate time zones in a Windows environment.\nIf you’re running Django on Windows, <a class=\"reference internal\" href=\"#std-setting-TIME_ZONE\"><code class=\"xref std std-setting docutils literal notranslate\">TIME_ZONE</code></a> must be set to\nmatch the system time zone.</p>\n</aside>\n</section>\n<section id=\"use-deprecated-pytz\">\n<span id=\"std-setting-USE_DEPRECATED_PYTZ\"></span><h3><code class=\"docutils literal notranslate\">USE_DEPRECATED_PYTZ</code><a class=\"heading-anchor\" href=\"#use-deprecated-pytz\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h3>\n<aside class=\"version-note version-added\" data-version=\"4.0\" role=\"note\">\n<p class=\"version-note-title\">New in Django 4.0</p></aside>\n<p>Default: <code class=\"docutils literal notranslate\">False</code></p>\n<p>A boolean that specifies whether to use <code class=\"docutils literal notranslate\">pytz</code>, rather than <a class=\"reference external\" href=\"https://docs.python.org/3/library/zoneinfo.html#module-zoneinfo\" title=\"(in Python v3.14)\"><code class=\"xref py py-mod docutils literal notranslate\">zoneinfo</code></a>,\nas the default time zone implementation.</p>\n<aside class=\"version-note version-deprecated\" data-version=\"4.0\" role=\"note\">\n<p class=\"version-note-title\">Deprecated since Django 4.0</p><p><span class=\"versionmodified deprecated\">Deprecato dalla versione 4.0: </span>This transitional setting is deprecated. Support for using <code class=\"docutils literal notranslate\">pytz</code> will be\nremoved in Django 5.0.</p>\n</aside>\n</section>\n<section id=\"use-i18n\">\n<span id=\"std-setting-USE_I18N\"></span><h3><code class=\"docutils literal notranslate\">USE_I18N</code><a class=\"heading-anchor\" href=\"#use-i18n\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h3>\n<p>Default: <code class=\"docutils literal notranslate\">True</code></p>\n<p>A boolean that specifies whether Django’s translation system should be enabled.\nThis provides a way to turn it off, for performance. If this is set to\n<code class=\"docutils literal notranslate\">False</code>, Django will make some optimizations so as not to load the\ntranslation machinery.</p>\n<p>See also <a class=\"reference internal\" href=\"#std-setting-LANGUAGE_CODE\"><code class=\"xref std std-setting docutils literal notranslate\">LANGUAGE_CODE</code></a>, <a class=\"reference internal\" href=\"#std-setting-USE_L10N\"><code class=\"xref std std-setting docutils literal notranslate\">USE_L10N</code></a> and <a class=\"reference internal\" href=\"#std-setting-USE_TZ\"><code class=\"xref std std-setting docutils literal notranslate\">USE_TZ</code></a>.</p>\n<aside class=\"admonition admonition-note\" role=\"note\">\n<p class=\"admonition-title\">Nota</p>\n<p>The default <code class=\"file docutils literal notranslate\">settings.py</code> file created by <a class=\"reference internal\" href=\"/it/4.1/ref/django-admin/#django-admin-startproject\"><code class=\"xref std std-djadmin docutils literal notranslate\">django-admin\nstartproject</code></a> includes <code class=\"docutils literal notranslate\">USE_I18N = True</code> for convenience.</p>\n</aside>\n</section>\n<section id=\"use-l10n\">\n<span id=\"std-setting-USE_L10N\"></span><h3><code class=\"docutils literal notranslate\">USE_L10N</code><a class=\"heading-anchor\" href=\"#use-l10n\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h3>\n<p>Default: <code class=\"docutils literal notranslate\">True</code></p>\n<p>A boolean that specifies if localized formatting of data will be enabled by\ndefault or not. If this is set to <code class=\"docutils literal notranslate\">True</code>, e.g. Django will display numbers and\ndates using the format of the current locale.</p>\n<p>See also <a class=\"reference internal\" href=\"#std-setting-LANGUAGE_CODE\"><code class=\"xref std std-setting docutils literal notranslate\">LANGUAGE_CODE</code></a>, <a class=\"reference internal\" href=\"#std-setting-USE_I18N\"><code class=\"xref std std-setting docutils literal notranslate\">USE_I18N</code></a> and <a class=\"reference internal\" href=\"#std-setting-USE_TZ\"><code class=\"xref std std-setting docutils literal notranslate\">USE_TZ</code></a>.</p>\n<aside class=\"version-note version-changed\" data-version=\"4.0\" role=\"note\">\n<p class=\"version-note-title\">Changed in Django 4.0</p><p>In older versions, the default value is <code class=\"docutils literal notranslate\">False</code>.</p>\n</aside>\n<aside class=\"version-note version-deprecated\" data-version=\"4.0\" role=\"note\">\n<p class=\"version-note-title\">Deprecated since Django 4.0</p><p><span class=\"versionmodified deprecated\">Deprecato dalla versione 4.0: </span>This setting is deprecated. Starting with Django 5.0, localized formatting\nof data will always be enabled. For example Django will display numbers and\ndates using the format of the current locale.</p>\n</aside>\n</section>\n<section id=\"use-thousand-separator\">\n<span id=\"std-setting-USE_THOUSAND_SEPARATOR\"></span><h3><code class=\"docutils literal notranslate\">USE_THOUSAND_SEPARATOR</code><a class=\"heading-anchor\" href=\"#use-thousand-separator\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h3>\n<p>Default: <code class=\"docutils literal notranslate\">False</code></p>\n<p>A boolean that specifies whether to display numbers using a thousand separator.\nWhen set to <code class=\"docutils literal notranslate\">True</code> and <a class=\"reference internal\" href=\"#std-setting-USE_L10N\"><code class=\"xref std std-setting docutils literal notranslate\">USE_L10N</code></a> is also <code class=\"docutils literal notranslate\">True</code>, Django will\nformat numbers using the <a class=\"reference internal\" href=\"#std-setting-NUMBER_GROUPING\"><code class=\"xref std std-setting docutils literal notranslate\">NUMBER_GROUPING</code></a> and\n<a class=\"reference internal\" href=\"#std-setting-THOUSAND_SEPARATOR\"><code class=\"xref std std-setting docutils literal notranslate\">THOUSAND_SEPARATOR</code></a> settings. The latter two settings may also be\ndictated by the locale, which takes precedence.</p>\n<p>See also <a class=\"reference internal\" href=\"#std-setting-DECIMAL_SEPARATOR\"><code class=\"xref std std-setting docutils literal notranslate\">DECIMAL_SEPARATOR</code></a>, <a class=\"reference internal\" href=\"#std-setting-NUMBER_GROUPING\"><code class=\"xref std std-setting docutils literal notranslate\">NUMBER_GROUPING</code></a> and\n<a class=\"reference internal\" href=\"#std-setting-THOUSAND_SEPARATOR\"><code class=\"xref std std-setting docutils literal notranslate\">THOUSAND_SEPARATOR</code></a>.</p>\n</section>\n<section id=\"use-tz\">\n<span id=\"std-setting-USE_TZ\"></span><h3><code class=\"docutils literal notranslate\">USE_TZ</code><a class=\"heading-anchor\" href=\"#use-tz\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h3>\n<p>Default: <code class=\"docutils literal notranslate\">False</code></p>\n<aside class=\"admonition admonition-note\" role=\"note\">\n<p class=\"admonition-title\">Nota</p>\n<p>In Django 5.0, the default value will change from <code class=\"docutils literal notranslate\">False</code> to <code class=\"docutils literal notranslate\">True</code>.</p>\n</aside>\n<p>A boolean that specifies if datetimes will be timezone-aware by default or not.\nIf this is set to <code class=\"docutils literal notranslate\">True</code>, Django will use timezone-aware datetimes internally.</p>\n<p>When <code class=\"docutils literal notranslate\">USE_TZ</code> is False, Django will use naive datetimes in local time, except\nwhen parsing ISO 8601 formatted strings, where timezone information will always\nbe retained if present.</p>\n<p>See also <a class=\"reference internal\" href=\"#std-setting-TIME_ZONE\"><code class=\"xref std std-setting docutils literal notranslate\">TIME_ZONE</code></a>, <a class=\"reference internal\" href=\"#std-setting-USE_I18N\"><code class=\"xref std std-setting docutils literal notranslate\">USE_I18N</code></a> and <a class=\"reference internal\" href=\"#std-setting-USE_L10N\"><code class=\"xref std std-setting docutils literal notranslate\">USE_L10N</code></a>.</p>\n<aside class=\"admonition admonition-note\" role=\"note\">\n<p class=\"admonition-title\">Nota</p>\n<p>The default <code class=\"file docutils literal notranslate\">settings.py</code> file created by\n<a class=\"reference internal\" href=\"/it/4.1/ref/django-admin/#django-admin-startproject\"><code class=\"xref std std-djadmin docutils literal notranslate\">django-admin startproject</code></a> includes\n<code class=\"docutils literal notranslate\">USE_TZ = True</code> for convenience.</p>\n</aside>\n</section>\n<section id=\"use-x-forwarded-host\">\n<span id=\"std-setting-USE_X_FORWARDED_HOST\"></span><h3><code class=\"docutils literal notranslate\">USE_X_FORWARDED_HOST</code><a class=\"heading-anchor\" href=\"#use-x-forwarded-host\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h3>\n<p>Default: <code class=\"docutils literal notranslate\">False</code></p>\n<p>A boolean that specifies whether to use the <code class=\"docutils literal notranslate\">X-Forwarded-Host</code> header in\npreference to the <code class=\"docutils literal notranslate\">Host</code> header. This should only be enabled if a proxy\nwhich sets this header is in use.</p>\n<p>This setting takes priority over <a class=\"reference internal\" href=\"#std-setting-USE_X_FORWARDED_PORT\"><code class=\"xref std std-setting docutils literal notranslate\">USE_X_FORWARDED_PORT</code></a>. Per\n<span class=\"target\" id=\"index-0\"></span><a class=\"rfc reference external\" href=\"https://datatracker.ietf.org/doc/html/rfc7239.html#section-5.3\"><strong>RFC 7239 Section 5.3</strong></a>, the <code class=\"docutils literal notranslate\">X-Forwarded-Host</code> header can include the port\nnumber, in which case you shouldn’t use <a class=\"reference internal\" href=\"#std-setting-USE_X_FORWARDED_PORT\"><code class=\"xref std std-setting docutils literal notranslate\">USE_X_FORWARDED_PORT</code></a>.</p>\n</section>\n<section id=\"use-x-forwarded-port\">\n<span id=\"std-setting-USE_X_FORWARDED_PORT\"></span><h3><code class=\"docutils literal notranslate\">USE_X_FORWARDED_PORT</code><a class=\"heading-anchor\" href=\"#use-x-forwarded-port\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h3>\n<p>Default: <code class=\"docutils literal notranslate\">False</code></p>\n<p>A boolean that specifies whether to use the <code class=\"docutils literal notranslate\">X-Forwarded-Port</code> header in\npreference to the <code class=\"docutils literal notranslate\">SERVER_PORT</code> <code class=\"docutils literal notranslate\">META</code> variable. This should only be\nenabled if a proxy which sets this header is in use.</p>\n<p><a class=\"reference internal\" href=\"#std-setting-USE_X_FORWARDED_HOST\"><code class=\"xref std std-setting docutils literal notranslate\">USE_X_FORWARDED_HOST</code></a> takes priority over this setting.</p>\n</section>\n<section id=\"wsgi-application\">\n<span id=\"std-setting-WSGI_APPLICATION\"></span><h3><code class=\"docutils literal notranslate\">WSGI_APPLICATION</code><a class=\"heading-anchor\" href=\"#wsgi-application\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h3>\n<p>Default: <code class=\"docutils literal notranslate\">None</code></p>\n<p>The full Python path of the WSGI application object that Django’s built-in\nservers (e.g. <a class=\"reference internal\" href=\"/it/4.1/ref/django-admin/#django-admin-runserver\"><code class=\"xref std std-djadmin docutils literal notranslate\">runserver</code></a>) will use. The <a class=\"reference internal\" href=\"/it/4.1/ref/django-admin/#django-admin-startproject\"><code class=\"xref std std-djadmin docutils literal notranslate\">django-admin\nstartproject</code></a> management command will create a standard\n<code class=\"docutils literal notranslate\">wsgi.py</code> file with an <code class=\"docutils literal notranslate\">application</code> callable in it, and point this setting\nto that <code class=\"docutils literal notranslate\">application</code>.</p>\n<p>If not set, the return value of <code class=\"docutils literal notranslate\">django.core.wsgi.get_wsgi_application()</code>\nwill be used. In this case, the behavior of <a class=\"reference internal\" href=\"/it/4.1/ref/django-admin/#django-admin-runserver\"><code class=\"xref std std-djadmin docutils literal notranslate\">runserver</code></a> will be\nidentical to previous Django versions.</p>\n</section>\n<section id=\"year-month-format\">\n<span id=\"std-setting-YEAR_MONTH_FORMAT\"></span><h3><code class=\"docutils literal notranslate\">YEAR_MONTH_FORMAT</code><a class=\"heading-anchor\" href=\"#year-month-format\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h3>\n<p>Default: <code class=\"docutils literal notranslate\">'F Y'</code></p>\n<p>The default formatting to use for date fields on Django admin change-list\npages – and, possibly, by other parts of the system – in cases when only the\nyear and month are displayed.</p>\n<p>For example, when a Django admin change-list page is being filtered by a date\ndrilldown, the header for a given month displays the month and the year.\nDifferent locales have different formats. For example, U.S. English would say\n«January 2006,» whereas another locale might say «2006/January.»</p>\n<p>Note that if <a class=\"reference internal\" href=\"#std-setting-USE_L10N\"><code class=\"xref std std-setting docutils literal notranslate\">USE_L10N</code></a> is set to <code class=\"docutils literal notranslate\">True</code>, then the corresponding\nlocale-dictated format has higher precedence and will be applied.</p>\n<p>See <a class=\"reference internal\" href=\"/it/4.1/ref/templates/builtins/#std-templatefilter-date\"><code class=\"xref std std-tfilter docutils literal notranslate\">allowed date format strings</code></a>. See also\n<a class=\"reference internal\" href=\"#std-setting-DATE_FORMAT\"><code class=\"xref std std-setting docutils literal notranslate\">DATE_FORMAT</code></a>, <a class=\"reference internal\" href=\"#std-setting-DATETIME_FORMAT\"><code class=\"xref std std-setting docutils literal notranslate\">DATETIME_FORMAT</code></a>, <a class=\"reference internal\" href=\"#std-setting-TIME_FORMAT\"><code class=\"xref std std-setting docutils literal notranslate\">TIME_FORMAT</code></a>\nand <a class=\"reference internal\" href=\"#std-setting-MONTH_DAY_FORMAT\"><code class=\"xref std std-setting docutils literal notranslate\">MONTH_DAY_FORMAT</code></a>.</p>\n</section>\n<section id=\"x-frame-options\">\n<span id=\"std-setting-X_FRAME_OPTIONS\"></span><h3><code class=\"docutils literal notranslate\">X_FRAME_OPTIONS</code><a class=\"heading-anchor\" href=\"#x-frame-options\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h3>\n<p>Default: <code class=\"docutils literal notranslate\">'DENY'</code></p>\n<p>The default value for the X-Frame-Options header used by\n<a class=\"reference internal\" href=\"/it/4.1/ref/middleware/#django.middleware.clickjacking.XFrameOptionsMiddleware\" title=\"django.middleware.clickjacking.XFrameOptionsMiddleware\"><code class=\"xref py py-class docutils literal notranslate\">XFrameOptionsMiddleware</code></a>. See the\n<a class=\"reference internal\" href=\"/it/4.1/ref/clickjacking/\"><span class=\"doc\">clickjacking protection</span></a> documentation.</p>\n</section>\n</section>\n<section id=\"auth\">\n<h2><a class=\"toc-backref\" href=\"#id13\" role=\"doc-backlink\">Auth</a><a class=\"headerlink\" href=\"#auth\" title=\"Link to this heading\">¶</a></h2>\n<p>Settings for <a class=\"reference internal\" href=\"/it/4.1/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>.</p>\n<section id=\"authentication-backends\">\n<span id=\"std-setting-AUTHENTICATION_BACKENDS\"></span><h3><code class=\"docutils literal notranslate\">AUTHENTICATION_BACKENDS</code><a class=\"heading-anchor\" href=\"#authentication-backends\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h3>\n<p>Default: <code class=\"docutils literal notranslate\">['django.contrib.auth.backends.ModelBackend']</code></p>\n<p>A list of authentication backend classes (as strings) to use when attempting to\nauthenticate a user. See the <a class=\"reference internal\" href=\"/it/4.1/topics/auth/customizing/#authentication-backends\"><span class=\"std std-ref\">authentication backends documentation</span></a> for details.</p>\n</section>\n<section id=\"auth-user-model\">\n<span id=\"std-setting-AUTH_USER_MODEL\"></span><h3><code class=\"docutils literal notranslate\">AUTH_USER_MODEL</code><a class=\"heading-anchor\" href=\"#auth-user-model\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h3>\n<p>Default: <code class=\"docutils literal notranslate\">'auth.User'</code></p>\n<p>The model to use to represent a User. See <a class=\"reference internal\" href=\"/it/4.1/topics/auth/customizing/#auth-custom-user\"><span class=\"std std-ref\">Substituting a custom User model</span></a>.</p>\n<aside class=\"admonition admonition-warning\" role=\"note\">\n<p class=\"admonition-title\">Avvertimento</p>\n<p>You cannot change the AUTH_USER_MODEL setting during the lifetime of\na project (i.e. once you have made and migrated models that depend on it)\nwithout serious effort. It is intended to be set at the project start,\nand the model it refers to must be available in the first migration of\nthe app that it lives in.\nSee <a class=\"reference internal\" href=\"/it/4.1/topics/auth/customizing/#auth-custom-user\"><span class=\"std std-ref\">Substituting a custom User model</span></a> for more details.</p>\n</aside>\n</section>\n<section id=\"login-redirect-url\">\n<span id=\"std-setting-LOGIN_REDIRECT_URL\"></span><h3><code class=\"docutils literal notranslate\">LOGIN_REDIRECT_URL</code><a class=\"heading-anchor\" href=\"#login-redirect-url\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h3>\n<p>Default: <code class=\"docutils literal notranslate\">'/accounts/profile/'</code></p>\n<p>The URL or <a class=\"reference internal\" href=\"/it/4.1/topics/http/urls/#naming-url-patterns\"><span class=\"std std-ref\">named URL pattern</span></a> where requests are\nredirected after login when the <a class=\"reference internal\" href=\"/it/4.1/topics/auth/default/#django.contrib.auth.views.LoginView\" title=\"django.contrib.auth.views.LoginView\"><code class=\"xref py py-class docutils literal notranslate\">LoginView</code></a>\ndoesn’t get a <code class=\"docutils literal notranslate\">next</code> GET parameter.</p>\n</section>\n<section id=\"login-url\">\n<span id=\"std-setting-LOGIN_URL\"></span><h3><code class=\"docutils literal notranslate\">LOGIN_URL</code><a class=\"heading-anchor\" href=\"#login-url\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h3>\n<p>Default: <code class=\"docutils literal notranslate\">'/accounts/login/'</code></p>\n<p>The URL or <a class=\"reference internal\" href=\"/it/4.1/topics/http/urls/#naming-url-patterns\"><span class=\"std std-ref\">named URL pattern</span></a> where requests are\nredirected for login when using the\n<a class=\"reference internal\" href=\"/it/4.1/topics/auth/default/#django.contrib.auth.decorators.login_required\" title=\"django.contrib.auth.decorators.login_required\"><code class=\"xref py py-func docutils literal notranslate\">login_required()</code></a> decorator,\n<a class=\"reference internal\" href=\"/it/4.1/topics/auth/default/#django.contrib.auth.mixins.LoginRequiredMixin\" title=\"django.contrib.auth.mixins.LoginRequiredMixin\"><code class=\"xref py py-class docutils literal notranslate\">LoginRequiredMixin</code></a>, or\n<a class=\"reference internal\" href=\"/it/4.1/topics/auth/default/#django.contrib.auth.mixins.AccessMixin\" title=\"django.contrib.auth.mixins.AccessMixin\"><code class=\"xref py py-class docutils literal notranslate\">AccessMixin</code></a>.</p>\n</section>\n<section id=\"logout-redirect-url\">\n<span id=\"std-setting-LOGOUT_REDIRECT_URL\"></span><h3><code class=\"docutils literal notranslate\">LOGOUT_REDIRECT_URL</code><a class=\"heading-anchor\" href=\"#logout-redirect-url\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h3>\n<p>Default: <code class=\"docutils literal notranslate\">None</code></p>\n<p>The URL or <a class=\"reference internal\" href=\"/it/4.1/topics/http/urls/#naming-url-patterns\"><span class=\"std std-ref\">named URL pattern</span></a> where requests are\nredirected after logout if <a class=\"reference internal\" href=\"/it/4.1/topics/auth/default/#django.contrib.auth.views.LogoutView\" title=\"django.contrib.auth.views.LogoutView\"><code class=\"xref py py-class docutils literal notranslate\">LogoutView</code></a>\ndoesn’t have a <code class=\"docutils literal notranslate\">next_page</code> attribute.</p>\n<p>If <code class=\"docutils literal notranslate\">None</code>, no redirect will be performed and the logout view will be\nrendered.</p>\n</section>\n<section id=\"password-reset-timeout\">\n<span id=\"std-setting-PASSWORD_RESET_TIMEOUT\"></span><h3><code class=\"docutils literal notranslate\">PASSWORD_RESET_TIMEOUT</code><a class=\"heading-anchor\" href=\"#password-reset-timeout\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h3>\n<p>Default: <code class=\"docutils literal notranslate\">259200</code> (3 days, in seconds)</p>\n<p>The number of seconds a password reset link is valid for.</p>\n<p>Used by the <a class=\"reference internal\" href=\"/it/4.1/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>.</p>\n<aside class=\"admonition admonition-note\" role=\"note\">\n<p class=\"admonition-title\">Nota</p>\n<p>Reducing the value of this timeout doesn’t make any difference to the\nability of an attacker to brute-force a password reset token. Tokens are\ndesigned to be safe from brute-forcing without any timeout.</p>\n<p>This timeout exists to protect against some unlikely attack scenarios, such\nas someone gaining access to email archives that may contain old, unused\npassword reset tokens.</p>\n</aside>\n</section>\n<section id=\"password-hashers\">\n<span id=\"std-setting-PASSWORD_HASHERS\"></span><h3><code class=\"docutils literal notranslate\">PASSWORD_HASHERS</code><a class=\"heading-anchor\" href=\"#password-hashers\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h3>\n<p>See <a class=\"reference internal\" href=\"/it/4.1/topics/auth/passwords/#auth-password-storage\"><span class=\"std std-ref\">How Django stores passwords</span></a>.</p>\n<p>Default:</p>\n<div class=\"code-block\" data-language=\"default\"><div class=\"code-block-toolbar\"><span class=\"code-block-language\">Code</span><button type=\"button\" class=\"copy-button\" data-copy hidden><span class=\"copy-button-label\">Copy</span></button></div><pre role=\"group\" tabindex=\"0\" aria-label=\"Code code\"><code><span class=\"p\">[</span>\n    <span class=\"s1\">&#39;django.contrib.auth.hashers.PBKDF2PasswordHasher&#39;</span><span class=\"p\">,</span>\n    <span class=\"s1\">&#39;django.contrib.auth.hashers.PBKDF2SHA1PasswordHasher&#39;</span><span class=\"p\">,</span>\n    <span class=\"s1\">&#39;django.contrib.auth.hashers.Argon2PasswordHasher&#39;</span><span class=\"p\">,</span>\n    <span class=\"s1\">&#39;django.contrib.auth.hashers.BCryptSHA256PasswordHasher&#39;</span><span class=\"p\">,</span>\n<span class=\"p\">]</span>\n</code></pre></div>\n</section>\n<section id=\"auth-password-validators\">\n<span id=\"std-setting-AUTH_PASSWORD_VALIDATORS\"></span><h3><code class=\"docutils literal notranslate\">AUTH_PASSWORD_VALIDATORS</code><a class=\"heading-anchor\" href=\"#auth-password-validators\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h3>\n<p>Default: <code class=\"docutils literal notranslate\">[]</code> (Empty list)</p>\n<p>The list of validators that are used to check the strength of user’s passwords.\nSee <a class=\"reference internal\" href=\"/it/4.1/topics/auth/passwords/#password-validation\"><span class=\"std std-ref\">Password validation</span></a> for more details. By default, no validation is\nperformed and all passwords are accepted.</p>\n</section>\n</section>\n<section id=\"messages\">\n<span id=\"settings-messages\"></span><h2><a class=\"toc-backref\" href=\"#id14\" role=\"doc-backlink\">Messages</a><a class=\"headerlink\" href=\"#messages\" title=\"Link to this heading\">¶</a></h2>\n<p>Settings for <a class=\"reference internal\" href=\"/it/4.1/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>.</p>\n<section id=\"message-level\">\n<span id=\"std-setting-MESSAGE_LEVEL\"></span><h3><code class=\"docutils literal notranslate\">MESSAGE_LEVEL</code><a class=\"heading-anchor\" href=\"#message-level\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h3>\n<p>Default: <code class=\"docutils literal notranslate\">messages.INFO</code></p>\n<p>Sets the minimum message level that will be recorded by the messages\nframework. See <a class=\"reference internal\" href=\"/it/4.1/ref/contrib/messages/#message-level\"><span class=\"std std-ref\">message levels</span></a> for more details.</p>\n<aside class=\"admonition-important admonition\" role=\"note\">\n<p class=\"admonition-title\">Important</p>\n<p>If you override <code class=\"docutils literal notranslate\">MESSAGE_LEVEL</code> in your settings file and rely on any of\nthe built-in constants, you must import the constants module directly to\navoid the potential for circular imports, e.g.:</p>\n<div class=\"code-block\" data-language=\"default\"><div class=\"code-block-toolbar\"><span class=\"code-block-language\">Code</span><button type=\"button\" class=\"copy-button\" data-copy hidden><span class=\"copy-button-label\">Copy</span></button></div><pre role=\"group\" tabindex=\"0\" aria-label=\"Code code\"><code><span class=\"kn\">from</span> <span class=\"nn\">django.contrib.messages</span> <span class=\"kn\">import</span> constants <span class=\"k\">as</span> message_constants\nMESSAGE_LEVEL <span class=\"o\">=</span> message_constants<span class=\"o\">.</span>DEBUG\n</code></pre></div>\n<p>If desired, you may specify the numeric values for the constants directly\naccording to the values in the above <a class=\"reference internal\" href=\"/it/4.1/ref/contrib/messages/#message-level-constants\"><span class=\"std std-ref\">constants table</span></a>.</p>\n</aside>\n</section>\n<section id=\"message-storage\">\n<span id=\"std-setting-MESSAGE_STORAGE\"></span><h3><code class=\"docutils literal notranslate\">MESSAGE_STORAGE</code><a class=\"heading-anchor\" href=\"#message-storage\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h3>\n<p>Default: <code class=\"docutils literal notranslate\">'django.contrib.messages.storage.fallback.FallbackStorage'</code></p>\n<p>Controls where Django stores message data. Valid values are:</p>\n<ul class=\"simple\">\n<li><p><code class=\"docutils literal notranslate\">'django.contrib.messages.storage.fallback.FallbackStorage'</code></p></li>\n<li><p><code class=\"docutils literal notranslate\">'django.contrib.messages.storage.session.SessionStorage'</code></p></li>\n<li><p><code class=\"docutils literal notranslate\">'django.contrib.messages.storage.cookie.CookieStorage'</code></p></li>\n</ul>\n<p>See <a class=\"reference internal\" href=\"/it/4.1/ref/contrib/messages/#message-storage-backends\"><span class=\"std std-ref\">message storage backends</span></a> for more details.</p>\n<p>The backends that use cookies –\n<a class=\"reference internal\" href=\"/it/4.1/ref/contrib/messages/#django.contrib.messages.storage.cookie.CookieStorage\" title=\"django.contrib.messages.storage.cookie.CookieStorage\"><code class=\"xref py py-class docutils literal notranslate\">CookieStorage</code></a> and\n<a class=\"reference internal\" href=\"/it/4.1/ref/contrib/messages/#django.contrib.messages.storage.fallback.FallbackStorage\" title=\"django.contrib.messages.storage.fallback.FallbackStorage\"><code class=\"xref py py-class docutils literal notranslate\">FallbackStorage</code></a> –\nuse the value of <a class=\"reference internal\" href=\"#std-setting-SESSION_COOKIE_DOMAIN\"><code class=\"xref std std-setting docutils literal notranslate\">SESSION_COOKIE_DOMAIN</code></a>, <a class=\"reference internal\" href=\"#std-setting-SESSION_COOKIE_SECURE\"><code class=\"xref std std-setting docutils literal notranslate\">SESSION_COOKIE_SECURE</code></a>\nand <a class=\"reference internal\" href=\"#std-setting-SESSION_COOKIE_HTTPONLY\"><code class=\"xref std std-setting docutils literal notranslate\">SESSION_COOKIE_HTTPONLY</code></a> when setting their cookies.</p>\n</section>\n<section id=\"message-tags\">\n<span id=\"std-setting-MESSAGE_TAGS\"></span><h3><code class=\"docutils literal notranslate\">MESSAGE_TAGS</code><a class=\"heading-anchor\" href=\"#message-tags\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h3>\n<p>Default:</p>\n<div class=\"code-block\" data-language=\"default\"><div class=\"code-block-toolbar\"><span class=\"code-block-language\">Code</span><button type=\"button\" class=\"copy-button\" data-copy hidden><span class=\"copy-button-label\">Copy</span></button></div><pre role=\"group\" tabindex=\"0\" aria-label=\"Code code\"><code><span class=\"p\">{</span>\n    messages<span class=\"o\">.</span>DEBUG<span class=\"p\">:</span> <span class=\"s1\">&#39;debug&#39;</span><span class=\"p\">,</span>\n    messages<span class=\"o\">.</span>INFO<span class=\"p\">:</span> <span class=\"s1\">&#39;info&#39;</span><span class=\"p\">,</span>\n    messages<span class=\"o\">.</span>SUCCESS<span class=\"p\">:</span> <span class=\"s1\">&#39;success&#39;</span><span class=\"p\">,</span>\n    messages<span class=\"o\">.</span>WARNING<span class=\"p\">:</span> <span class=\"s1\">&#39;warning&#39;</span><span class=\"p\">,</span>\n    messages<span class=\"o\">.</span>ERROR<span class=\"p\">:</span> <span class=\"s1\">&#39;error&#39;</span><span class=\"p\">,</span>\n<span class=\"p\">}</span>\n</code></pre></div>\n<p>This sets the mapping of message level to message tag, which is typically\nrendered as a CSS class in HTML. If you specify a value, it will extend\nthe default. This means you only have to specify those values which you need\nto override. See <a class=\"reference internal\" href=\"/it/4.1/ref/contrib/messages/#message-displaying\"><span class=\"std std-ref\">Displaying messages</span></a> above for more details.</p>\n<aside class=\"admonition-important admonition\" role=\"note\">\n<p class=\"admonition-title\">Important</p>\n<p>If you override <code class=\"docutils literal notranslate\">MESSAGE_TAGS</code> in your settings file and rely on any of\nthe built-in constants, you must import the <code class=\"docutils literal notranslate\">constants</code> module directly to\navoid the potential for circular imports, e.g.:</p>\n<div class=\"code-block\" data-language=\"default\"><div class=\"code-block-toolbar\"><span class=\"code-block-language\">Code</span><button type=\"button\" class=\"copy-button\" data-copy hidden><span class=\"copy-button-label\">Copy</span></button></div><pre role=\"group\" tabindex=\"0\" aria-label=\"Code code\"><code><span class=\"kn\">from</span> <span class=\"nn\">django.contrib.messages</span> <span class=\"kn\">import</span> constants <span class=\"k\">as</span> message_constants\nMESSAGE_TAGS <span class=\"o\">=</span> <span class=\"p\">{</span>message_constants<span class=\"o\">.</span>INFO<span class=\"p\">:</span> <span class=\"s1\">&#39;&#39;</span><span class=\"p\">}</span>\n</code></pre></div>\n<p>If desired, you may specify the numeric values for the constants directly\naccording to the values in the above <a class=\"reference internal\" href=\"/it/4.1/ref/contrib/messages/#message-level-constants\"><span class=\"std std-ref\">constants table</span></a>.</p>\n</aside>\n</section>\n</section>\n<section id=\"sessions\">\n<span id=\"settings-sessions\"></span><h2><a class=\"toc-backref\" href=\"#id15\" role=\"doc-backlink\">Sessions</a><a class=\"headerlink\" href=\"#sessions\" title=\"Link to this heading\">¶</a></h2>\n<p>Settings for <a class=\"reference internal\" href=\"/it/4.1/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>.</p>\n<section id=\"session-cache-alias\">\n<span id=\"std-setting-SESSION_CACHE_ALIAS\"></span><h3><code class=\"docutils literal notranslate\">SESSION_CACHE_ALIAS</code><a class=\"heading-anchor\" href=\"#session-cache-alias\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h3>\n<p>Default: <code class=\"docutils literal notranslate\">'default'</code></p>\n<p>If you’re using <a class=\"reference internal\" href=\"/it/4.1/topics/http/sessions/#cached-sessions-backend\"><span class=\"std std-ref\">cache-based session storage</span></a>,\nthis selects the cache to use.</p>\n</section>\n<section id=\"session-cookie-age\">\n<span id=\"std-setting-SESSION_COOKIE_AGE\"></span><h3><code class=\"docutils literal notranslate\">SESSION_COOKIE_AGE</code><a class=\"heading-anchor\" href=\"#session-cookie-age\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h3>\n<p>Default: <code class=\"docutils literal notranslate\">1209600</code> (2 weeks, in seconds)</p>\n<p>The age of session cookies, in seconds.</p>\n</section>\n<section id=\"session-cookie-domain\">\n<span id=\"std-setting-SESSION_COOKIE_DOMAIN\"></span><h3><code class=\"docutils literal notranslate\">SESSION_COOKIE_DOMAIN</code><a class=\"heading-anchor\" href=\"#session-cookie-domain\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h3>\n<p>Default: <code class=\"docutils literal notranslate\">None</code></p>\n<p>The domain to use for session cookies. Set this to a string such as\n<code class=\"docutils literal notranslate\">&quot;example.com&quot;</code> for cross-domain cookies, or use <code class=\"docutils literal notranslate\">None</code> for a standard\ndomain cookie.</p>\n<p>To use cross-domain cookies with <a class=\"reference internal\" href=\"#std-setting-CSRF_USE_SESSIONS\"><code class=\"xref std std-setting docutils literal notranslate\">CSRF_USE_SESSIONS</code></a>, you must include\na leading dot (e.g. <code class=\"docutils literal notranslate\">&quot;.example.com&quot;</code>) to accommodate the CSRF middleware’s\nreferer checking.</p>\n<p>Be cautious when updating this setting on a production site. If you update\nthis setting to enable cross-domain cookies on a site that previously used\nstandard domain cookies, existing user cookies will be set to the old\ndomain. This may result in them being unable to log in as long as these cookies\npersist.</p>\n<p>This setting also affects cookies set by <a class=\"reference internal\" href=\"/it/4.1/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>.</p>\n</section>\n<section id=\"session-cookie-httponly\">\n<span id=\"std-setting-SESSION_COOKIE_HTTPONLY\"></span><h3><code class=\"docutils literal notranslate\">SESSION_COOKIE_HTTPONLY</code><a class=\"heading-anchor\" href=\"#session-cookie-httponly\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h3>\n<p>Default: <code class=\"docutils literal notranslate\">True</code></p>\n<p>Whether to use <code class=\"docutils literal notranslate\">HttpOnly</code> flag on the session cookie. If this is set to\n<code class=\"docutils literal notranslate\">True</code>, client-side JavaScript will not be able to access the session\ncookie.</p>\n<p><a class=\"reference external\" href=\"https://owasp.org/www-community/HttpOnly\">HttpOnly</a> is a flag included in a Set-Cookie HTTP response header. It’s part of\nthe <span class=\"target\" id=\"index-1\"></span><a class=\"rfc reference external\" href=\"https://datatracker.ietf.org/doc/html/rfc6265.html#section-4.1.2.6\"><strong>RFC 6265 Section 4.1.2.6</strong></a> standard for cookies and can be a useful way to\nmitigate the risk of a client-side script accessing the protected cookie data.</p>\n<p>This makes it less trivial for an attacker to escalate a cross-site scripting\nvulnerability into full hijacking of a user’s session. There aren’t many good\nreasons for turning this off. Your code shouldn’t read session cookies from\nJavaScript.</p>\n</section>\n<section id=\"session-cookie-name\">\n<span id=\"std-setting-SESSION_COOKIE_NAME\"></span><h3><code class=\"docutils literal notranslate\">SESSION_COOKIE_NAME</code><a class=\"heading-anchor\" href=\"#session-cookie-name\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h3>\n<p>Default: <code class=\"docutils literal notranslate\">'sessionid'</code></p>\n<p>The name of the cookie to use for sessions. This can be whatever you want\n(as long as it’s different from the other cookie names in your application).</p>\n</section>\n<section id=\"session-cookie-path\">\n<span id=\"std-setting-SESSION_COOKIE_PATH\"></span><h3><code class=\"docutils literal notranslate\">SESSION_COOKIE_PATH</code><a class=\"heading-anchor\" href=\"#session-cookie-path\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h3>\n<p>Default: <code class=\"docutils literal notranslate\">'/'</code></p>\n<p>The path set on the session cookie. This should either match the URL path of your\nDjango installation or be parent of that path.</p>\n<p>This is useful if you have multiple Django instances running under the same\nhostname. They can use different cookie paths, and each instance will only see\nits own session cookie.</p>\n</section>\n<section id=\"session-cookie-samesite\">\n<span id=\"std-setting-SESSION_COOKIE_SAMESITE\"></span><h3><code class=\"docutils literal notranslate\">SESSION_COOKIE_SAMESITE</code><a class=\"heading-anchor\" href=\"#session-cookie-samesite\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h3>\n<p>Default: <code class=\"docutils literal notranslate\">'Lax'</code></p>\n<p>The value of the <a class=\"reference external\" href=\"https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Set-Cookie/SameSite\">SameSite</a> flag on the session cookie. This flag prevents the\ncookie from being sent in cross-site requests thus preventing CSRF attacks and\nmaking some methods of stealing session cookie impossible.</p>\n<p>Possible values for the setting are:</p>\n<ul>\n<li><p><code class=\"docutils literal notranslate\">'Strict'</code>: prevents the cookie from being sent by the browser to the\ntarget site in all cross-site browsing context, even when following a regular\nlink.</p>\n<p>For example, for a GitHub-like website this would mean that if a logged-in\nuser follows a link to a private GitHub project posted on a corporate\ndiscussion forum or email, GitHub will not receive the session cookie and the\nuser won’t be able to access the project. A bank website, however, most\nlikely doesn’t want to allow any transactional pages to be linked from\nexternal sites so the <code class=\"docutils literal notranslate\">'Strict'</code> flag would be appropriate.</p>\n</li>\n<li><p><code class=\"docutils literal notranslate\">'Lax'</code> (default): provides a balance between security and usability for\nwebsites that want to maintain user’s logged-in session after the user\narrives from an external link.</p>\n<p>In the GitHub scenario, the session cookie would be allowed when following a\nregular link from an external website and be blocked in CSRF-prone request\nmethods (e.g. <code class=\"docutils literal notranslate\">POST</code>).</p>\n</li>\n<li><p><code class=\"docutils literal notranslate\">'None'</code> (string): the session cookie will be sent with all same-site and\ncross-site requests.</p></li>\n<li><p><code class=\"docutils literal notranslate\">False</code>: disables the flag.</p></li>\n</ul>\n<aside class=\"admonition admonition-note\" role=\"note\">\n<p class=\"admonition-title\">Nota</p>\n<p>Modern browsers provide a more secure default policy for the <code class=\"docutils literal notranslate\">SameSite</code>\nflag and will assume <code class=\"docutils literal notranslate\">Lax</code> for cookies without an explicit value set.</p>\n</aside>\n</section>\n<section id=\"session-cookie-secure\">\n<span id=\"std-setting-SESSION_COOKIE_SECURE\"></span><h3><code class=\"docutils literal notranslate\">SESSION_COOKIE_SECURE</code><a class=\"heading-anchor\" href=\"#session-cookie-secure\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h3>\n<p>Default: <code class=\"docutils literal notranslate\">False</code></p>\n<p>Whether to use a secure cookie for the session cookie. If this is set to\n<code class=\"docutils literal notranslate\">True</code>, the cookie will be marked as «secure», which means browsers may\nensure that the cookie is only sent under an HTTPS connection.</p>\n<p>Leaving this setting off isn’t a good idea because an attacker could capture an\nunencrypted session cookie with a packet sniffer and use the cookie to hijack\nthe user’s session.</p>\n</section>\n<section id=\"session-engine\">\n<span id=\"std-setting-SESSION_ENGINE\"></span><h3><code class=\"docutils literal notranslate\">SESSION_ENGINE</code><a class=\"heading-anchor\" href=\"#session-engine\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h3>\n<p>Default: <code class=\"docutils literal notranslate\">'django.contrib.sessions.backends.db'</code></p>\n<p>Controls where Django stores session data. Included engines are:</p>\n<ul class=\"simple\">\n<li><p><code class=\"docutils literal notranslate\">'django.contrib.sessions.backends.db'</code></p></li>\n<li><p><code class=\"docutils literal notranslate\">'django.contrib.sessions.backends.file'</code></p></li>\n<li><p><code class=\"docutils literal notranslate\">'django.contrib.sessions.backends.cache'</code></p></li>\n<li><p><code class=\"docutils literal notranslate\">'django.contrib.sessions.backends.cached_db'</code></p></li>\n<li><p><code class=\"docutils literal notranslate\">'django.contrib.sessions.backends.signed_cookies'</code></p></li>\n</ul>\n<p>See <a class=\"reference internal\" href=\"/it/4.1/topics/http/sessions/#configuring-sessions\"><span class=\"std std-ref\">Configuring the session engine</span></a> for more details.</p>\n</section>\n<section id=\"session-expire-at-browser-close\">\n<span id=\"std-setting-SESSION_EXPIRE_AT_BROWSER_CLOSE\"></span><h3><code class=\"docutils literal notranslate\">SESSION_EXPIRE_AT_BROWSER_CLOSE</code><a class=\"heading-anchor\" href=\"#session-expire-at-browser-close\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h3>\n<p>Default: <code class=\"docutils literal notranslate\">False</code></p>\n<p>Whether to expire the session when the user closes their browser. See\n<a class=\"reference internal\" href=\"/it/4.1/topics/http/sessions/#browser-length-vs-persistent-sessions\"><span class=\"std std-ref\">Browser-length sessions vs. persistent sessions</span></a>.</p>\n</section>\n<section id=\"session-file-path\">\n<span id=\"std-setting-SESSION_FILE_PATH\"></span><h3><code class=\"docutils literal notranslate\">SESSION_FILE_PATH</code><a class=\"heading-anchor\" href=\"#session-file-path\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h3>\n<p>Default: <code class=\"docutils literal notranslate\">None</code></p>\n<p>If you’re using file-based session storage, this sets the directory in\nwhich Django will store session data. When the default value (<code class=\"docutils literal notranslate\">None</code>) is\nused, Django will use the standard temporary directory for the system.</p>\n</section>\n<section id=\"session-save-every-request\">\n<span id=\"std-setting-SESSION_SAVE_EVERY_REQUEST\"></span><h3><code class=\"docutils literal notranslate\">SESSION_SAVE_EVERY_REQUEST</code><a class=\"heading-anchor\" href=\"#session-save-every-request\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h3>\n<p>Default: <code class=\"docutils literal notranslate\">False</code></p>\n<p>Whether to save the session data on every request. If this is <code class=\"docutils literal notranslate\">False</code>\n(default), then the session data will only be saved if it has been modified –\nthat is, if any of its dictionary values have been assigned or deleted. Empty\nsessions won’t be created, even if this setting is active.</p>\n</section>\n<section id=\"session-serializer\">\n<span id=\"std-setting-SESSION_SERIALIZER\"></span><h3><code class=\"docutils literal notranslate\">SESSION_SERIALIZER</code><a class=\"heading-anchor\" href=\"#session-serializer\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h3>\n<p>Default: <code class=\"docutils literal notranslate\">'django.contrib.sessions.serializers.JSONSerializer'</code></p>\n<p>Full import path of a serializer class to use for serializing session data.\nIncluded serializer is:</p>\n<ul class=\"simple\">\n<li><p><code class=\"docutils literal notranslate\">'django.contrib.sessions.serializers.JSONSerializer'</code></p></li>\n</ul>\n<p>See <a class=\"reference internal\" href=\"/it/4.1/topics/http/sessions/#session-serialization\"><span class=\"std std-ref\">Session serialization</span></a> for details.</p>\n</section>\n</section>\n<section id=\"sites\">\n<h2><a class=\"toc-backref\" href=\"#id16\" role=\"doc-backlink\">Sites</a><a class=\"headerlink\" href=\"#sites\" title=\"Link to this heading\">¶</a></h2>\n<p>Settings for <a class=\"reference internal\" href=\"/it/4.1/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>.</p>\n<section id=\"site-id\">\n<span id=\"std-setting-SITE_ID\"></span><h3><code class=\"docutils literal notranslate\">SITE_ID</code><a class=\"heading-anchor\" href=\"#site-id\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h3>\n<p>Default: Not defined</p>\n<p>The ID, as an integer, of the current site in the <code class=\"docutils literal notranslate\">django_site</code> database\ntable. This is used so that application data can hook into specific sites\nand a single database can manage content for multiple sites.</p>\n</section>\n</section>\n<section id=\"static-files\">\n<span id=\"settings-staticfiles\"></span><h2><a class=\"toc-backref\" href=\"#id17\" role=\"doc-backlink\">Static Files</a><a class=\"headerlink\" href=\"#static-files\" title=\"Link to this heading\">¶</a></h2>\n<p>Settings for <a class=\"reference internal\" href=\"/it/4.1/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>.</p>\n<section id=\"static-root\">\n<span id=\"std-setting-STATIC_ROOT\"></span><h3><code class=\"docutils literal notranslate\">STATIC_ROOT</code><a class=\"heading-anchor\" href=\"#static-root\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h3>\n<p>Default: <code class=\"docutils literal notranslate\">None</code></p>\n<p>The absolute path to the directory where <a class=\"reference internal\" href=\"/it/4.1/ref/contrib/staticfiles/#django-admin-collectstatic\"><code class=\"xref std std-djadmin docutils literal notranslate\">collectstatic</code></a> will collect\nstatic files for deployment.</p>\n<p>Example: <code class=\"docutils literal notranslate\">&quot;/var/www/example.com/static/&quot;</code></p>\n<p>If the <a class=\"reference internal\" href=\"/it/4.1/ref/contrib/staticfiles/\"><span class=\"doc\">staticfiles</span></a> contrib app is enabled\n(as in the default project template), the <a class=\"reference internal\" href=\"/it/4.1/ref/contrib/staticfiles/#django-admin-collectstatic\"><code class=\"xref std std-djadmin docutils literal notranslate\">collectstatic</code></a> management\ncommand will collect static files into this directory. See the how-to on\n<a class=\"reference internal\" href=\"/it/4.1/howto/static-files/\"><span class=\"doc\">managing static files</span></a> for more details about\nusage.</p>\n<aside class=\"admonition admonition-warning\" role=\"note\">\n<p class=\"admonition-title\">Avvertimento</p>\n<p>This should be an initially empty destination directory for collecting\nyour static files from their permanent locations into one directory for\nease of deployment; it is <strong>not</strong> a place to store your static files\npermanently. You should do that in directories that will be found by\n<a class=\"reference internal\" href=\"/it/4.1/ref/contrib/staticfiles/\"><span class=\"doc\">staticfiles</span></a>’s\n<a class=\"reference internal\" href=\"#std-setting-STATICFILES_FINDERS\"><code class=\"xref std std-setting docutils literal notranslate\">finders</code></a>, which by default, are\n<code class=\"docutils literal notranslate\">'static/'</code> app sub-directories and any directories you include in\n<a class=\"reference internal\" href=\"#std-setting-STATICFILES_DIRS\"><code class=\"xref std std-setting docutils literal notranslate\">STATICFILES_DIRS</code></a>).</p>\n</aside>\n</section>\n<section id=\"static-url\">\n<span id=\"std-setting-STATIC_URL\"></span><h3><code class=\"docutils literal notranslate\">STATIC_URL</code><a class=\"heading-anchor\" href=\"#static-url\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h3>\n<p>Default: <code class=\"docutils literal notranslate\">None</code></p>\n<p>URL to use when referring to static files located in <a class=\"reference internal\" href=\"#std-setting-STATIC_ROOT\"><code class=\"xref std std-setting docutils literal notranslate\">STATIC_ROOT</code></a>.</p>\n<p>Example: <code class=\"docutils literal notranslate\">&quot;static/&quot;</code> or <code class=\"docutils literal notranslate\">&quot;http://static.example.com/&quot;</code></p>\n<p>If not <code class=\"docutils literal notranslate\">None</code>, this will be used as the base path for\n<a class=\"reference internal\" href=\"/it/4.1/topics/forms/media/#form-asset-paths\"><span class=\"std std-ref\">asset definitions</span></a> (the <code class=\"docutils literal notranslate\">Media</code> class) and the\n<a class=\"reference internal\" href=\"/it/4.1/ref/contrib/staticfiles/\"><span class=\"doc\">staticfiles app</span></a>.</p>\n<p>It must end in a slash if set to a non-empty value.</p>\n<p>You may need to <a class=\"reference internal\" href=\"/it/4.1/howto/static-files/#serving-static-files-in-development\"><span class=\"std std-ref\">configure these files to be served in development</span></a> and will definitely need to do so\n<a class=\"reference internal\" href=\"/it/4.1/howto/static-files/deployment/\"><span class=\"doc\">in production</span></a>.</p>\n<aside class=\"admonition admonition-note\" role=\"note\">\n<p class=\"admonition-title\">Nota</p>\n<p>If <a class=\"reference internal\" href=\"#std-setting-STATIC_URL\"><code class=\"xref std std-setting docutils literal notranslate\">STATIC_URL</code></a> is a relative path, then it will be prefixed by\nthe server-provided value of <code class=\"docutils literal notranslate\">SCRIPT_NAME</code> (or <code class=\"docutils literal notranslate\">/</code> if not set). This\nmakes it easier to serve a Django application in a subpath without adding\nan extra configuration to the settings.</p>\n</aside>\n</section>\n<section id=\"staticfiles-dirs\">\n<span id=\"std-setting-STATICFILES_DIRS\"></span><h3><code class=\"docutils literal notranslate\">STATICFILES_DIRS</code><a class=\"heading-anchor\" href=\"#staticfiles-dirs\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h3>\n<p>Default: <code class=\"docutils literal notranslate\">[]</code> (Empty list)</p>\n<p>This setting defines the additional locations the staticfiles app will traverse\nif the <code class=\"docutils literal notranslate\">FileSystemFinder</code> finder is enabled, e.g. if you use the\n<a class=\"reference internal\" href=\"/it/4.1/ref/contrib/staticfiles/#django-admin-collectstatic\"><code class=\"xref std std-djadmin docutils literal notranslate\">collectstatic</code></a> or <a class=\"reference internal\" href=\"/it/4.1/ref/contrib/staticfiles/#django-admin-findstatic\"><code class=\"xref std std-djadmin docutils literal notranslate\">findstatic</code></a> management command or use the\nstatic file serving view.</p>\n<p>This should be set to a list of strings that contain full paths to\nyour additional files directory(ies) e.g.:</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>STATICFILES_DIRS <span class=\"o\">=</span> <span class=\"p\">[</span>\n    <span class=\"s2\">&quot;/home/special.polls.com/polls/static&quot;</span><span class=\"p\">,</span>\n    <span class=\"s2\">&quot;/home/polls.com/polls/static&quot;</span><span class=\"p\">,</span>\n    <span class=\"s2\">&quot;/opt/webfiles/common&quot;</span><span class=\"p\">,</span>\n<span class=\"p\">]</span>\n</code></pre></div>\n<p>Note that these paths should use Unix-style forward slashes, even on Windows\n(e.g. <code class=\"docutils literal notranslate\">&quot;C:/Users/user/mysite/extra_static_content&quot;</code>).</p>\n<section id=\"prefixes-optional\">\n<span id=\"staticfiles-dirs-prefixes\"></span><h4>Prefixes (optional)<a class=\"heading-anchor\" href=\"#prefixes-optional\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h4>\n<p>In case you want to refer to files in one of the locations with an additional\nnamespace, you can <strong>optionally</strong> provide a prefix as <code class=\"docutils literal notranslate\">(prefix, path)</code>\ntuples, e.g.:</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>STATICFILES_DIRS <span class=\"o\">=</span> <span class=\"p\">[</span>\n    <span class=\"c1\"># ...</span>\n    <span class=\"p\">(</span><span class=\"s2\">&quot;downloads&quot;</span><span class=\"p\">,</span> <span class=\"s2\">&quot;/opt/webfiles/stats&quot;</span><span class=\"p\">),</span>\n<span class=\"p\">]</span>\n</code></pre></div>\n<p>For example, assuming you have <a class=\"reference internal\" href=\"#std-setting-STATIC_URL\"><code class=\"xref std std-setting docutils literal notranslate\">STATIC_URL</code></a> set to <code class=\"docutils literal notranslate\">'static/'</code>, the\n<a class=\"reference internal\" href=\"/it/4.1/ref/contrib/staticfiles/#django-admin-collectstatic\"><code class=\"xref std std-djadmin docutils literal notranslate\">collectstatic</code></a> management command would collect the «stats» files\nin a <code class=\"docutils literal notranslate\">'downloads'</code> subdirectory of <a class=\"reference internal\" href=\"#std-setting-STATIC_ROOT\"><code class=\"xref std std-setting docutils literal notranslate\">STATIC_ROOT</code></a>.</p>\n<p>This would allow you to refer to the local file\n<code class=\"docutils literal notranslate\">'/opt/webfiles/stats/polls_20101022.tar.gz'</code> with\n<code class=\"docutils literal notranslate\">'/static/downloads/polls_20101022.tar.gz'</code> in your templates, e.g.:</p>\n<div class=\"code-block\" data-language=\"html+django\"><div class=\"code-block-toolbar\"><span class=\"code-block-language\">Django template</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=\"Django template code\"><code><span class=\"p\">&lt;</span><span class=\"nt\">a</span> <span class=\"na\">href</span><span class=\"o\">=</span><span class=\"s\">&quot;</span><span class=\"cp\">{%</span> <span class=\"k\">static</span> <span class=\"s1\">&#39;downloads/polls_20101022.tar.gz&#39;</span> <span class=\"cp\">%}</span><span class=\"s\">&quot;</span><span class=\"p\">&gt;</span>\n</code></pre></div>\n</section>\n</section>\n<section id=\"staticfiles-storage\">\n<span id=\"std-setting-STATICFILES_STORAGE\"></span><h3><code class=\"docutils literal notranslate\">STATICFILES_STORAGE</code><a class=\"heading-anchor\" href=\"#staticfiles-storage\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h3>\n<p>Default: <code class=\"docutils literal notranslate\">'django.contrib.staticfiles.storage.StaticFilesStorage'</code></p>\n<p>The file storage engine to use when collecting static files with the\n<a class=\"reference internal\" href=\"/it/4.1/ref/contrib/staticfiles/#django-admin-collectstatic\"><code class=\"xref std std-djadmin docutils literal notranslate\">collectstatic</code></a> management command.</p>\n<p>A ready-to-use instance of the storage backend defined in this setting\ncan be found at <code class=\"docutils literal notranslate\">django.contrib.staticfiles.storage.staticfiles_storage</code>.</p>\n<p>For an example, see <a class=\"reference internal\" href=\"/it/4.1/howto/static-files/deployment/#staticfiles-from-cdn\"><span class=\"std std-ref\">Distribuire file statici da un servizio cloud o da una CDN</span></a>.</p>\n</section>\n<section id=\"staticfiles-finders\">\n<span id=\"std-setting-STATICFILES_FINDERS\"></span><h3><code class=\"docutils literal notranslate\">STATICFILES_FINDERS</code><a class=\"heading-anchor\" href=\"#staticfiles-finders\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h3>\n<p>Default:</p>\n<div class=\"code-block\" data-language=\"default\"><div class=\"code-block-toolbar\"><span class=\"code-block-language\">Code</span><button type=\"button\" class=\"copy-button\" data-copy hidden><span class=\"copy-button-label\">Copy</span></button></div><pre role=\"group\" tabindex=\"0\" aria-label=\"Code code\"><code><span class=\"p\">[</span>\n    <span class=\"s1\">&#39;django.contrib.staticfiles.finders.FileSystemFinder&#39;</span><span class=\"p\">,</span>\n    <span class=\"s1\">&#39;django.contrib.staticfiles.finders.AppDirectoriesFinder&#39;</span><span class=\"p\">,</span>\n<span class=\"p\">]</span>\n</code></pre></div>\n<p>The list of finder backends that know how to find static files in\nvarious locations.</p>\n<p>The default will find files stored in the <a class=\"reference internal\" href=\"#std-setting-STATICFILES_DIRS\"><code class=\"xref std std-setting docutils literal notranslate\">STATICFILES_DIRS</code></a> setting\n(using <code class=\"docutils literal notranslate\">django.contrib.staticfiles.finders.FileSystemFinder</code>) and in a\n<code class=\"docutils literal notranslate\">static</code> subdirectory of each app (using\n<code class=\"docutils literal notranslate\">django.contrib.staticfiles.finders.AppDirectoriesFinder</code>). If multiple\nfiles with the same name are present, the first file that is found will be\nused.</p>\n<p>One finder is disabled by default:\n<code class=\"docutils literal notranslate\">django.contrib.staticfiles.finders.DefaultStorageFinder</code>. If added to\nyour <a class=\"reference internal\" href=\"#std-setting-STATICFILES_FINDERS\"><code class=\"xref std std-setting docutils literal notranslate\">STATICFILES_FINDERS</code></a> setting, it will look for static files in\nthe default file storage as defined by the <a class=\"reference internal\" href=\"#std-setting-DEFAULT_FILE_STORAGE\"><code class=\"xref std std-setting docutils literal notranslate\">DEFAULT_FILE_STORAGE</code></a>\nsetting.</p>\n<aside class=\"admonition admonition-note\" role=\"note\">\n<p class=\"admonition-title\">Nota</p>\n<p>When using the <code class=\"docutils literal notranslate\">AppDirectoriesFinder</code> finder, make sure your apps\ncan be found by staticfiles by adding the app to the\n<a class=\"reference internal\" href=\"#std-setting-INSTALLED_APPS\"><code class=\"xref std std-setting docutils literal notranslate\">INSTALLED_APPS</code></a> setting of your site.</p>\n</aside>\n<p>Static file finders are currently considered a private interface, and this\ninterface is thus undocumented.</p>\n</section>\n</section>\n<section id=\"core-settings-topical-index\">\n<h2><a class=\"toc-backref\" href=\"#id18\" role=\"doc-backlink\">Core Settings Topical Index</a><a class=\"headerlink\" href=\"#core-settings-topical-index\" title=\"Link to this heading\">¶</a></h2>\n<section id=\"cache\">\n<h3>Cache<a class=\"heading-anchor\" href=\"#cache\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h3>\n<ul class=\"simple\">\n<li><p><a class=\"reference internal\" href=\"#std-setting-CACHES\"><code class=\"xref std std-setting docutils literal notranslate\">CACHES</code></a></p></li>\n<li><p><a class=\"reference internal\" href=\"#std-setting-CACHE_MIDDLEWARE_ALIAS\"><code class=\"xref std std-setting docutils literal notranslate\">CACHE_MIDDLEWARE_ALIAS</code></a></p></li>\n<li><p><a class=\"reference internal\" href=\"#std-setting-CACHE_MIDDLEWARE_KEY_PREFIX\"><code class=\"xref std std-setting docutils literal notranslate\">CACHE_MIDDLEWARE_KEY_PREFIX</code></a></p></li>\n<li><p><a class=\"reference internal\" href=\"#std-setting-CACHE_MIDDLEWARE_SECONDS\"><code class=\"xref std std-setting docutils literal notranslate\">CACHE_MIDDLEWARE_SECONDS</code></a></p></li>\n</ul>\n</section>\n<section id=\"database\">\n<h3>Database<a class=\"heading-anchor\" href=\"#database\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h3>\n<ul class=\"simple\">\n<li><p><a class=\"reference internal\" href=\"#std-setting-DATABASES\"><code class=\"xref std std-setting docutils literal notranslate\">DATABASES</code></a></p></li>\n<li><p><a class=\"reference internal\" href=\"#std-setting-DATABASE_ROUTERS\"><code class=\"xref std std-setting docutils literal notranslate\">DATABASE_ROUTERS</code></a></p></li>\n<li><p><a class=\"reference internal\" href=\"#std-setting-DEFAULT_INDEX_TABLESPACE\"><code class=\"xref std std-setting docutils literal notranslate\">DEFAULT_INDEX_TABLESPACE</code></a></p></li>\n<li><p><a class=\"reference internal\" href=\"#std-setting-DEFAULT_TABLESPACE\"><code class=\"xref std std-setting docutils literal notranslate\">DEFAULT_TABLESPACE</code></a></p></li>\n</ul>\n</section>\n<section id=\"debugging\">\n<h3>Debugging<a class=\"heading-anchor\" href=\"#debugging\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h3>\n<ul class=\"simple\">\n<li><p><a class=\"reference internal\" href=\"#std-setting-DEBUG\"><code class=\"xref std std-setting docutils literal notranslate\">DEBUG</code></a></p></li>\n<li><p><a class=\"reference internal\" href=\"#std-setting-DEBUG_PROPAGATE_EXCEPTIONS\"><code class=\"xref std std-setting docutils literal notranslate\">DEBUG_PROPAGATE_EXCEPTIONS</code></a></p></li>\n</ul>\n</section>\n<section id=\"email\">\n<h3>Email<a class=\"heading-anchor\" href=\"#email\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h3>\n<ul class=\"simple\">\n<li><p><a class=\"reference internal\" href=\"#std-setting-ADMINS\"><code class=\"xref std std-setting docutils literal notranslate\">ADMINS</code></a></p></li>\n<li><p><a class=\"reference internal\" href=\"#std-setting-DEFAULT_CHARSET\"><code class=\"xref std std-setting docutils literal notranslate\">DEFAULT_CHARSET</code></a></p></li>\n<li><p><a class=\"reference internal\" href=\"#std-setting-DEFAULT_FROM_EMAIL\"><code class=\"xref std std-setting docutils literal notranslate\">DEFAULT_FROM_EMAIL</code></a></p></li>\n<li><p><a class=\"reference internal\" href=\"#std-setting-EMAIL_BACKEND\"><code class=\"xref std std-setting docutils literal notranslate\">EMAIL_BACKEND</code></a></p></li>\n<li><p><a class=\"reference internal\" href=\"#std-setting-EMAIL_FILE_PATH\"><code class=\"xref std std-setting docutils literal notranslate\">EMAIL_FILE_PATH</code></a></p></li>\n<li><p><a class=\"reference internal\" href=\"#std-setting-EMAIL_HOST\"><code class=\"xref std std-setting docutils literal notranslate\">EMAIL_HOST</code></a></p></li>\n<li><p><a class=\"reference internal\" href=\"#std-setting-EMAIL_HOST_PASSWORD\"><code class=\"xref std std-setting docutils literal notranslate\">EMAIL_HOST_PASSWORD</code></a></p></li>\n<li><p><a class=\"reference internal\" href=\"#std-setting-EMAIL_HOST_USER\"><code class=\"xref std std-setting docutils literal notranslate\">EMAIL_HOST_USER</code></a></p></li>\n<li><p><a class=\"reference internal\" href=\"#std-setting-EMAIL_PORT\"><code class=\"xref std std-setting docutils literal notranslate\">EMAIL_PORT</code></a></p></li>\n<li><p><a class=\"reference internal\" href=\"#std-setting-EMAIL_SSL_CERTFILE\"><code class=\"xref std std-setting docutils literal notranslate\">EMAIL_SSL_CERTFILE</code></a></p></li>\n<li><p><a class=\"reference internal\" href=\"#std-setting-EMAIL_SSL_KEYFILE\"><code class=\"xref std std-setting docutils literal notranslate\">EMAIL_SSL_KEYFILE</code></a></p></li>\n<li><p><a class=\"reference internal\" href=\"#std-setting-EMAIL_SUBJECT_PREFIX\"><code class=\"xref std std-setting docutils literal notranslate\">EMAIL_SUBJECT_PREFIX</code></a></p></li>\n<li><p><a class=\"reference internal\" href=\"#std-setting-EMAIL_TIMEOUT\"><code class=\"xref std std-setting docutils literal notranslate\">EMAIL_TIMEOUT</code></a></p></li>\n<li><p><a class=\"reference internal\" href=\"#std-setting-EMAIL_USE_LOCALTIME\"><code class=\"xref std std-setting docutils literal notranslate\">EMAIL_USE_LOCALTIME</code></a></p></li>\n<li><p><a class=\"reference internal\" href=\"#std-setting-EMAIL_USE_TLS\"><code class=\"xref std std-setting docutils literal notranslate\">EMAIL_USE_TLS</code></a></p></li>\n<li><p><a class=\"reference internal\" href=\"#std-setting-MANAGERS\"><code class=\"xref std std-setting docutils literal notranslate\">MANAGERS</code></a></p></li>\n<li><p><a class=\"reference internal\" href=\"#std-setting-SERVER_EMAIL\"><code class=\"xref std std-setting docutils literal notranslate\">SERVER_EMAIL</code></a></p></li>\n</ul>\n</section>\n<section id=\"error-reporting\">\n<h3>Error reporting<a class=\"heading-anchor\" href=\"#error-reporting\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h3>\n<ul class=\"simple\">\n<li><p><a class=\"reference internal\" href=\"#std-setting-DEFAULT_EXCEPTION_REPORTER\"><code class=\"xref std std-setting docutils literal notranslate\">DEFAULT_EXCEPTION_REPORTER</code></a></p></li>\n<li><p><a class=\"reference internal\" href=\"#std-setting-DEFAULT_EXCEPTION_REPORTER_FILTER\"><code class=\"xref std std-setting docutils literal notranslate\">DEFAULT_EXCEPTION_REPORTER_FILTER</code></a></p></li>\n<li><p><a class=\"reference internal\" href=\"#std-setting-IGNORABLE_404_URLS\"><code class=\"xref std std-setting docutils literal notranslate\">IGNORABLE_404_URLS</code></a></p></li>\n<li><p><a class=\"reference internal\" href=\"#std-setting-MANAGERS\"><code class=\"xref std std-setting docutils literal notranslate\">MANAGERS</code></a></p></li>\n<li><p><a class=\"reference internal\" href=\"#std-setting-SILENCED_SYSTEM_CHECKS\"><code class=\"xref std std-setting docutils literal notranslate\">SILENCED_SYSTEM_CHECKS</code></a></p></li>\n</ul>\n</section>\n<section id=\"file-uploads\">\n<span id=\"file-upload-settings\"></span><h3>File uploads<a class=\"heading-anchor\" href=\"#file-uploads\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h3>\n<ul class=\"simple\">\n<li><p><a class=\"reference internal\" href=\"#std-setting-DEFAULT_FILE_STORAGE\"><code class=\"xref std std-setting docutils literal notranslate\">DEFAULT_FILE_STORAGE</code></a></p></li>\n<li><p><a class=\"reference internal\" href=\"#std-setting-FILE_UPLOAD_HANDLERS\"><code class=\"xref std std-setting docutils literal notranslate\">FILE_UPLOAD_HANDLERS</code></a></p></li>\n<li><p><a class=\"reference internal\" href=\"#std-setting-FILE_UPLOAD_MAX_MEMORY_SIZE\"><code class=\"xref std std-setting docutils literal notranslate\">FILE_UPLOAD_MAX_MEMORY_SIZE</code></a></p></li>\n<li><p><a class=\"reference internal\" href=\"#std-setting-FILE_UPLOAD_PERMISSIONS\"><code class=\"xref std std-setting docutils literal notranslate\">FILE_UPLOAD_PERMISSIONS</code></a></p></li>\n<li><p><a class=\"reference internal\" href=\"#std-setting-FILE_UPLOAD_TEMP_DIR\"><code class=\"xref std std-setting docutils literal notranslate\">FILE_UPLOAD_TEMP_DIR</code></a></p></li>\n<li><p><a class=\"reference internal\" href=\"#std-setting-MEDIA_ROOT\"><code class=\"xref std std-setting docutils literal notranslate\">MEDIA_ROOT</code></a></p></li>\n<li><p><a class=\"reference internal\" href=\"#std-setting-MEDIA_URL\"><code class=\"xref std std-setting docutils literal notranslate\">MEDIA_URL</code></a></p></li>\n</ul>\n</section>\n<section id=\"forms\">\n<h3>Forms<a class=\"heading-anchor\" href=\"#forms\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h3>\n<ul class=\"simple\">\n<li><p><a class=\"reference internal\" href=\"#std-setting-FORM_RENDERER\"><code class=\"xref std std-setting docutils literal notranslate\">FORM_RENDERER</code></a></p></li>\n</ul>\n</section>\n<section id=\"globalization-i18n-l10n\">\n<h3>Globalization (<code class=\"docutils literal notranslate\">i18n</code>/<code class=\"docutils literal notranslate\">l10n</code>)<a class=\"heading-anchor\" href=\"#globalization-i18n-l10n\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h3>\n<ul class=\"simple\">\n<li><p><a class=\"reference internal\" href=\"#std-setting-DATE_FORMAT\"><code class=\"xref std std-setting docutils literal notranslate\">DATE_FORMAT</code></a></p></li>\n<li><p><a class=\"reference internal\" href=\"#std-setting-DATE_INPUT_FORMATS\"><code class=\"xref std std-setting docutils literal notranslate\">DATE_INPUT_FORMATS</code></a></p></li>\n<li><p><a class=\"reference internal\" href=\"#std-setting-DATETIME_FORMAT\"><code class=\"xref std std-setting docutils literal notranslate\">DATETIME_FORMAT</code></a></p></li>\n<li><p><a class=\"reference internal\" href=\"#std-setting-DATETIME_INPUT_FORMATS\"><code class=\"xref std std-setting docutils literal notranslate\">DATETIME_INPUT_FORMATS</code></a></p></li>\n<li><p><a class=\"reference internal\" href=\"#std-setting-DECIMAL_SEPARATOR\"><code class=\"xref std std-setting docutils literal notranslate\">DECIMAL_SEPARATOR</code></a></p></li>\n<li><p><a class=\"reference internal\" href=\"#std-setting-FIRST_DAY_OF_WEEK\"><code class=\"xref std std-setting docutils literal notranslate\">FIRST_DAY_OF_WEEK</code></a></p></li>\n<li><p><a class=\"reference internal\" href=\"#std-setting-FORMAT_MODULE_PATH\"><code class=\"xref std std-setting docutils literal notranslate\">FORMAT_MODULE_PATH</code></a></p></li>\n<li><p><a class=\"reference internal\" href=\"#std-setting-LANGUAGE_CODE\"><code class=\"xref std std-setting docutils literal notranslate\">LANGUAGE_CODE</code></a></p></li>\n<li><p><a class=\"reference internal\" href=\"#std-setting-LANGUAGE_COOKIE_AGE\"><code class=\"xref std std-setting docutils literal notranslate\">LANGUAGE_COOKIE_AGE</code></a></p></li>\n<li><p><a class=\"reference internal\" href=\"#std-setting-LANGUAGE_COOKIE_DOMAIN\"><code class=\"xref std std-setting docutils literal notranslate\">LANGUAGE_COOKIE_DOMAIN</code></a></p></li>\n<li><p><a class=\"reference internal\" href=\"#std-setting-LANGUAGE_COOKIE_HTTPONLY\"><code class=\"xref std std-setting docutils literal notranslate\">LANGUAGE_COOKIE_HTTPONLY</code></a></p></li>\n<li><p><a class=\"reference internal\" href=\"#std-setting-LANGUAGE_COOKIE_NAME\"><code class=\"xref std std-setting docutils literal notranslate\">LANGUAGE_COOKIE_NAME</code></a></p></li>\n<li><p><a class=\"reference internal\" href=\"#std-setting-LANGUAGE_COOKIE_PATH\"><code class=\"xref std std-setting docutils literal notranslate\">LANGUAGE_COOKIE_PATH</code></a></p></li>\n<li><p><a class=\"reference internal\" href=\"#std-setting-LANGUAGE_COOKIE_SAMESITE\"><code class=\"xref std std-setting docutils literal notranslate\">LANGUAGE_COOKIE_SAMESITE</code></a></p></li>\n<li><p><a class=\"reference internal\" href=\"#std-setting-LANGUAGE_COOKIE_SECURE\"><code class=\"xref std std-setting docutils literal notranslate\">LANGUAGE_COOKIE_SECURE</code></a></p></li>\n<li><p><a class=\"reference internal\" href=\"#std-setting-LANGUAGES\"><code class=\"xref std std-setting docutils literal notranslate\">LANGUAGES</code></a></p></li>\n<li><p><a class=\"reference internal\" href=\"#std-setting-LANGUAGES_BIDI\"><code class=\"xref std std-setting docutils literal notranslate\">LANGUAGES_BIDI</code></a></p></li>\n<li><p><a class=\"reference internal\" href=\"#std-setting-LOCALE_PATHS\"><code class=\"xref std std-setting docutils literal notranslate\">LOCALE_PATHS</code></a></p></li>\n<li><p><a class=\"reference internal\" href=\"#std-setting-MONTH_DAY_FORMAT\"><code class=\"xref std std-setting docutils literal notranslate\">MONTH_DAY_FORMAT</code></a></p></li>\n<li><p><a class=\"reference internal\" href=\"#std-setting-NUMBER_GROUPING\"><code class=\"xref std std-setting docutils literal notranslate\">NUMBER_GROUPING</code></a></p></li>\n<li><p><a class=\"reference internal\" href=\"#std-setting-SHORT_DATE_FORMAT\"><code class=\"xref std std-setting docutils literal notranslate\">SHORT_DATE_FORMAT</code></a></p></li>\n<li><p><a class=\"reference internal\" href=\"#std-setting-SHORT_DATETIME_FORMAT\"><code class=\"xref std std-setting docutils literal notranslate\">SHORT_DATETIME_FORMAT</code></a></p></li>\n<li><p><a class=\"reference internal\" href=\"#std-setting-THOUSAND_SEPARATOR\"><code class=\"xref std std-setting docutils literal notranslate\">THOUSAND_SEPARATOR</code></a></p></li>\n<li><p><a class=\"reference internal\" href=\"#std-setting-TIME_FORMAT\"><code class=\"xref std std-setting docutils literal notranslate\">TIME_FORMAT</code></a></p></li>\n<li><p><a class=\"reference internal\" href=\"#std-setting-TIME_INPUT_FORMATS\"><code class=\"xref std std-setting docutils literal notranslate\">TIME_INPUT_FORMATS</code></a></p></li>\n<li><p><a class=\"reference internal\" href=\"#std-setting-TIME_ZONE\"><code class=\"xref std std-setting docutils literal notranslate\">TIME_ZONE</code></a></p></li>\n<li><p><a class=\"reference internal\" href=\"#std-setting-USE_I18N\"><code class=\"xref std std-setting docutils literal notranslate\">USE_I18N</code></a></p></li>\n<li><p><a class=\"reference internal\" href=\"#std-setting-USE_L10N\"><code class=\"xref std std-setting docutils literal notranslate\">USE_L10N</code></a></p></li>\n<li><p><a class=\"reference internal\" href=\"#std-setting-USE_THOUSAND_SEPARATOR\"><code class=\"xref std std-setting docutils literal notranslate\">USE_THOUSAND_SEPARATOR</code></a></p></li>\n<li><p><a class=\"reference internal\" href=\"#std-setting-USE_TZ\"><code class=\"xref std std-setting docutils literal notranslate\">USE_TZ</code></a></p></li>\n<li><p><a class=\"reference internal\" href=\"#std-setting-YEAR_MONTH_FORMAT\"><code class=\"xref std std-setting docutils literal notranslate\">YEAR_MONTH_FORMAT</code></a></p></li>\n</ul>\n</section>\n<section id=\"http\">\n<h3>HTTP<a class=\"heading-anchor\" href=\"#http\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h3>\n<ul class=\"simple\">\n<li><p><a class=\"reference internal\" href=\"#std-setting-DATA_UPLOAD_MAX_MEMORY_SIZE\"><code class=\"xref std std-setting docutils literal notranslate\">DATA_UPLOAD_MAX_MEMORY_SIZE</code></a></p></li>\n<li><p><a class=\"reference internal\" href=\"#std-setting-DATA_UPLOAD_MAX_NUMBER_FIELDS\"><code class=\"xref std std-setting docutils literal notranslate\">DATA_UPLOAD_MAX_NUMBER_FIELDS</code></a></p></li>\n<li><p><a class=\"reference internal\" href=\"#std-setting-DATA_UPLOAD_MAX_NUMBER_FILES\"><code class=\"xref std std-setting docutils literal notranslate\">DATA_UPLOAD_MAX_NUMBER_FILES</code></a></p></li>\n<li><p><a class=\"reference internal\" href=\"#std-setting-DEFAULT_CHARSET\"><code class=\"xref std std-setting docutils literal notranslate\">DEFAULT_CHARSET</code></a></p></li>\n<li><p><a class=\"reference internal\" href=\"#std-setting-DISALLOWED_USER_AGENTS\"><code class=\"xref std std-setting docutils literal notranslate\">DISALLOWED_USER_AGENTS</code></a></p></li>\n<li><p><a class=\"reference internal\" href=\"#std-setting-FORCE_SCRIPT_NAME\"><code class=\"xref std std-setting docutils literal notranslate\">FORCE_SCRIPT_NAME</code></a></p></li>\n<li><p><a class=\"reference internal\" href=\"#std-setting-INTERNAL_IPS\"><code class=\"xref std std-setting docutils literal notranslate\">INTERNAL_IPS</code></a></p></li>\n<li><p><a class=\"reference internal\" href=\"#std-setting-MIDDLEWARE\"><code class=\"xref std std-setting docutils literal notranslate\">MIDDLEWARE</code></a></p></li>\n<li><p>Security</p>\n<ul>\n<li><p><a class=\"reference internal\" href=\"#std-setting-SECURE_CONTENT_TYPE_NOSNIFF\"><code class=\"xref std std-setting docutils literal notranslate\">SECURE_CONTENT_TYPE_NOSNIFF</code></a></p></li>\n<li><p><a class=\"reference internal\" href=\"#std-setting-SECURE_CROSS_ORIGIN_OPENER_POLICY\"><code class=\"xref std std-setting docutils literal notranslate\">SECURE_CROSS_ORIGIN_OPENER_POLICY</code></a></p></li>\n<li><p><a class=\"reference internal\" href=\"#std-setting-SECURE_HSTS_INCLUDE_SUBDOMAINS\"><code class=\"xref std std-setting docutils literal notranslate\">SECURE_HSTS_INCLUDE_SUBDOMAINS</code></a></p></li>\n<li><p><a class=\"reference internal\" href=\"#std-setting-SECURE_HSTS_PRELOAD\"><code class=\"xref std std-setting docutils literal notranslate\">SECURE_HSTS_PRELOAD</code></a></p></li>\n<li><p><a class=\"reference internal\" href=\"#std-setting-SECURE_HSTS_SECONDS\"><code class=\"xref std std-setting docutils literal notranslate\">SECURE_HSTS_SECONDS</code></a></p></li>\n<li><p><a class=\"reference internal\" href=\"#std-setting-SECURE_PROXY_SSL_HEADER\"><code class=\"xref std std-setting docutils literal notranslate\">SECURE_PROXY_SSL_HEADER</code></a></p></li>\n<li><p><a class=\"reference internal\" href=\"#std-setting-SECURE_REDIRECT_EXEMPT\"><code class=\"xref std std-setting docutils literal notranslate\">SECURE_REDIRECT_EXEMPT</code></a></p></li>\n<li><p><a class=\"reference internal\" href=\"#std-setting-SECURE_REFERRER_POLICY\"><code class=\"xref std std-setting docutils literal notranslate\">SECURE_REFERRER_POLICY</code></a></p></li>\n<li><p><a class=\"reference internal\" href=\"#std-setting-SECURE_SSL_HOST\"><code class=\"xref std std-setting docutils literal notranslate\">SECURE_SSL_HOST</code></a></p></li>\n<li><p><a class=\"reference internal\" href=\"#std-setting-SECURE_SSL_REDIRECT\"><code class=\"xref std std-setting docutils literal notranslate\">SECURE_SSL_REDIRECT</code></a></p></li>\n</ul>\n</li>\n<li><p><a class=\"reference internal\" href=\"#std-setting-SIGNING_BACKEND\"><code class=\"xref std std-setting docutils literal notranslate\">SIGNING_BACKEND</code></a></p></li>\n<li><p><a class=\"reference internal\" href=\"#std-setting-USE_X_FORWARDED_HOST\"><code class=\"xref std std-setting docutils literal notranslate\">USE_X_FORWARDED_HOST</code></a></p></li>\n<li><p><a class=\"reference internal\" href=\"#std-setting-USE_X_FORWARDED_PORT\"><code class=\"xref std std-setting docutils literal notranslate\">USE_X_FORWARDED_PORT</code></a></p></li>\n<li><p><a class=\"reference internal\" href=\"#std-setting-WSGI_APPLICATION\"><code class=\"xref std std-setting docutils literal notranslate\">WSGI_APPLICATION</code></a></p></li>\n</ul>\n</section>\n<section id=\"id10\">\n<h3>Logging<a class=\"heading-anchor\" href=\"#id10\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h3>\n<ul class=\"simple\">\n<li><p><a class=\"reference internal\" href=\"#std-setting-LOGGING\"><code class=\"xref std std-setting docutils literal notranslate\">LOGGING</code></a></p></li>\n<li><p><a class=\"reference internal\" href=\"#std-setting-LOGGING_CONFIG\"><code class=\"xref std std-setting docutils literal notranslate\">LOGGING_CONFIG</code></a></p></li>\n</ul>\n</section>\n<section id=\"models\">\n<h3>Models<a class=\"heading-anchor\" href=\"#models\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h3>\n<ul class=\"simple\">\n<li><p><a class=\"reference internal\" href=\"#std-setting-ABSOLUTE_URL_OVERRIDES\"><code class=\"xref std std-setting docutils literal notranslate\">ABSOLUTE_URL_OVERRIDES</code></a></p></li>\n<li><p><a class=\"reference internal\" href=\"#std-setting-FIXTURE_DIRS\"><code class=\"xref std std-setting docutils literal notranslate\">FIXTURE_DIRS</code></a></p></li>\n<li><p><a class=\"reference internal\" href=\"#std-setting-INSTALLED_APPS\"><code class=\"xref std std-setting docutils literal notranslate\">INSTALLED_APPS</code></a></p></li>\n</ul>\n</section>\n<section id=\"security\">\n<h3>Security<a class=\"heading-anchor\" href=\"#security\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h3>\n<ul class=\"simple\">\n<li><p>Cross Site Request Forgery Protection</p>\n<ul>\n<li><p><a class=\"reference internal\" href=\"#std-setting-CSRF_COOKIE_DOMAIN\"><code class=\"xref std std-setting docutils literal notranslate\">CSRF_COOKIE_DOMAIN</code></a></p></li>\n<li><p><a class=\"reference internal\" href=\"#std-setting-CSRF_COOKIE_NAME\"><code class=\"xref std std-setting docutils literal notranslate\">CSRF_COOKIE_NAME</code></a></p></li>\n<li><p><a class=\"reference internal\" href=\"#std-setting-CSRF_COOKIE_PATH\"><code class=\"xref std std-setting docutils literal notranslate\">CSRF_COOKIE_PATH</code></a></p></li>\n<li><p><a class=\"reference internal\" href=\"#std-setting-CSRF_COOKIE_SAMESITE\"><code class=\"xref std std-setting docutils literal notranslate\">CSRF_COOKIE_SAMESITE</code></a></p></li>\n<li><p><a class=\"reference internal\" href=\"#std-setting-CSRF_COOKIE_SECURE\"><code class=\"xref std std-setting docutils literal notranslate\">CSRF_COOKIE_SECURE</code></a></p></li>\n<li><p><a class=\"reference internal\" href=\"#std-setting-CSRF_FAILURE_VIEW\"><code class=\"xref std std-setting docutils literal notranslate\">CSRF_FAILURE_VIEW</code></a></p></li>\n<li><p><a class=\"reference internal\" href=\"#std-setting-CSRF_HEADER_NAME\"><code class=\"xref std std-setting docutils literal notranslate\">CSRF_HEADER_NAME</code></a></p></li>\n<li><p><a class=\"reference internal\" href=\"#std-setting-CSRF_TRUSTED_ORIGINS\"><code class=\"xref std std-setting docutils literal notranslate\">CSRF_TRUSTED_ORIGINS</code></a></p></li>\n<li><p><a class=\"reference internal\" href=\"#std-setting-CSRF_USE_SESSIONS\"><code class=\"xref std std-setting docutils literal notranslate\">CSRF_USE_SESSIONS</code></a></p></li>\n</ul>\n</li>\n<li><p><a class=\"reference internal\" href=\"#std-setting-SECRET_KEY\"><code class=\"xref std std-setting docutils literal notranslate\">SECRET_KEY</code></a></p></li>\n<li><p><a class=\"reference internal\" href=\"#std-setting-SECRET_KEY_FALLBACKS\"><code class=\"xref std std-setting docutils literal notranslate\">SECRET_KEY_FALLBACKS</code></a></p></li>\n<li><p><a class=\"reference internal\" href=\"#std-setting-X_FRAME_OPTIONS\"><code class=\"xref std std-setting docutils literal notranslate\">X_FRAME_OPTIONS</code></a></p></li>\n</ul>\n</section>\n<section id=\"serialization\">\n<h3>Serialization<a class=\"heading-anchor\" href=\"#serialization\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h3>\n<ul class=\"simple\">\n<li><p><a class=\"reference internal\" href=\"#std-setting-DEFAULT_CHARSET\"><code class=\"xref std std-setting docutils literal notranslate\">DEFAULT_CHARSET</code></a></p></li>\n<li><p><a class=\"reference internal\" href=\"#std-setting-SERIALIZATION_MODULES\"><code class=\"xref std std-setting docutils literal notranslate\">SERIALIZATION_MODULES</code></a></p></li>\n</ul>\n</section>\n<section id=\"id11\">\n<h3>Templates<a class=\"heading-anchor\" href=\"#id11\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h3>\n<ul class=\"simple\">\n<li><p><a class=\"reference internal\" href=\"#std-setting-TEMPLATES\"><code class=\"xref std std-setting docutils literal notranslate\">TEMPLATES</code></a></p></li>\n</ul>\n</section>\n<section id=\"testing\">\n<h3>Testing<a class=\"heading-anchor\" href=\"#testing\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h3>\n<ul class=\"simple\">\n<li><p>Database: <a class=\"reference internal\" href=\"#std-setting-DATABASE-TEST\"><code class=\"xref std std-setting docutils literal notranslate\">TEST</code></a></p></li>\n<li><p><a class=\"reference internal\" href=\"#std-setting-TEST_NON_SERIALIZED_APPS\"><code class=\"xref std std-setting docutils literal notranslate\">TEST_NON_SERIALIZED_APPS</code></a></p></li>\n<li><p><a class=\"reference internal\" href=\"#std-setting-TEST_RUNNER\"><code class=\"xref std std-setting docutils literal notranslate\">TEST_RUNNER</code></a></p></li>\n</ul>\n</section>\n<section id=\"urls\">\n<h3>URLs<a class=\"heading-anchor\" href=\"#urls\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h3>\n<ul class=\"simple\">\n<li><p><a class=\"reference internal\" href=\"#std-setting-APPEND_SLASH\"><code class=\"xref std std-setting docutils literal notranslate\">APPEND_SLASH</code></a></p></li>\n<li><p><a class=\"reference internal\" href=\"#std-setting-PREPEND_WWW\"><code class=\"xref std std-setting docutils literal notranslate\">PREPEND_WWW</code></a></p></li>\n<li><p><a class=\"reference internal\" href=\"#std-setting-ROOT_URLCONF\"><code class=\"xref std std-setting docutils literal notranslate\">ROOT_URLCONF</code></a></p></li>\n</ul>\n</section>\n</section>","rootId":"settings","toc":[{"title":"Core Settings","anchor":"core-settings","children":[{"title":"ABSOLUTE_URL_OVERRIDES","anchor":"absolute-url-overrides","children":[]},{"title":"ADMINS","anchor":"admins","children":[]},{"title":"ALLOWED_HOSTS","anchor":"allowed-hosts","children":[]},{"title":"APPEND_SLASH","anchor":"append-slash","children":[]},{"title":"CACHES","anchor":"caches","children":[{"title":"BACKEND","anchor":"backend","children":[]},{"title":"KEY_FUNCTION","anchor":"key-function","children":[]},{"title":"KEY_PREFIX","anchor":"key-prefix","children":[]},{"title":"LOCATION","anchor":"location","children":[]},{"title":"OPTIONS","anchor":"options","children":[]},{"title":"TIMEOUT","anchor":"timeout","children":[]},{"title":"VERSION","anchor":"version","children":[]}]},{"title":"CACHE_MIDDLEWARE_ALIAS","anchor":"cache-middleware-alias","children":[]},{"title":"CACHE_MIDDLEWARE_KEY_PREFIX","anchor":"cache-middleware-key-prefix","children":[]},{"title":"CACHE_MIDDLEWARE_SECONDS","anchor":"cache-middleware-seconds","children":[]},{"title":"CSRF_COOKIE_AGE","anchor":"csrf-cookie-age","children":[]},{"title":"CSRF_COOKIE_DOMAIN","anchor":"csrf-cookie-domain","children":[]},{"title":"CSRF_COOKIE_HTTPONLY","anchor":"csrf-cookie-httponly","children":[]},{"title":"CSRF_COOKIE_MASKED","anchor":"csrf-cookie-masked","children":[]},{"title":"CSRF_COOKIE_NAME","anchor":"csrf-cookie-name","children":[]},{"title":"CSRF_COOKIE_PATH","anchor":"csrf-cookie-path","children":[]},{"title":"CSRF_COOKIE_SAMESITE","anchor":"csrf-cookie-samesite","children":[]},{"title":"CSRF_COOKIE_SECURE","anchor":"csrf-cookie-secure","children":[]},{"title":"CSRF_USE_SESSIONS","anchor":"csrf-use-sessions","children":[]},{"title":"CSRF_FAILURE_VIEW","anchor":"csrf-failure-view","children":[]},{"title":"CSRF_HEADER_NAME","anchor":"csrf-header-name","children":[]},{"title":"CSRF_TRUSTED_ORIGINS","anchor":"csrf-trusted-origins","children":[]},{"title":"DATABASES","anchor":"databases","children":[{"title":"ATOMIC_REQUESTS","anchor":"atomic-requests","children":[]},{"title":"AUTOCOMMIT","anchor":"autocommit","children":[]},{"title":"ENGINE","anchor":"engine","children":[]},{"title":"HOST","anchor":"host","children":[]},{"title":"NAME","anchor":"name","children":[]},{"title":"CONN_MAX_AGE","anchor":"conn-max-age","children":[]},{"title":"CONN_HEALTH_CHECKS","anchor":"conn-health-checks","children":[]},{"title":"OPTIONS","anchor":"std-setting-OPTIONS","children":[]},{"title":"PASSWORD","anchor":"password","children":[]},{"title":"PORT","anchor":"port","children":[]},{"title":"TIME_ZONE","anchor":"time-zone","children":[]},{"title":"DISABLE_SERVER_SIDE_CURSORS","anchor":"disable-server-side-cursors","children":[]},{"title":"USER","anchor":"user","children":[]},{"title":"TEST","anchor":"test","children":[{"title":"CHARSET","anchor":"charset","children":[]},{"title":"COLLATION","anchor":"collation","children":[]},{"title":"DEPENDENCIES","anchor":"dependencies","children":[]},{"title":"MIGRATE","anchor":"migrate","children":[]},{"title":"MIRROR","anchor":"mirror","children":[]},{"title":"NAME","anchor":"std-setting-TEST_NAME","children":[]},{"title":"SERIALIZE","anchor":"serialize","children":[]},{"title":"TEMPLATE","anchor":"template","children":[]},{"title":"CREATE_DB","anchor":"create-db","children":[]},{"title":"CREATE_USER","anchor":"create-user","children":[]},{"title":"USER","anchor":"std-setting-TEST_USER","children":[]},{"title":"PASSWORD","anchor":"std-setting-TEST_PASSWD","children":[]},{"title":"ORACLE_MANAGED_FILES","anchor":"oracle-managed-files","children":[]},{"title":"TBLSPACE","anchor":"tblspace","children":[]},{"title":"TBLSPACE_TMP","anchor":"tblspace-tmp","children":[]},{"title":"DATAFILE","anchor":"datafile","children":[]},{"title":"DATAFILE_TMP","anchor":"datafile-tmp","children":[]},{"title":"DATAFILE_MAXSIZE","anchor":"datafile-maxsize","children":[]},{"title":"DATAFILE_TMP_MAXSIZE","anchor":"datafile-tmp-maxsize","children":[]},{"title":"DATAFILE_SIZE","anchor":"datafile-size","children":[]},{"title":"DATAFILE_TMP_SIZE","anchor":"datafile-tmp-size","children":[]},{"title":"DATAFILE_EXTSIZE","anchor":"datafile-extsize","children":[]},{"title":"DATAFILE_TMP_EXTSIZE","anchor":"datafile-tmp-extsize","children":[]}]}]},{"title":"DATA_UPLOAD_MAX_MEMORY_SIZE","anchor":"data-upload-max-memory-size","children":[]},{"title":"DATA_UPLOAD_MAX_NUMBER_FIELDS","anchor":"data-upload-max-number-fields","children":[]},{"title":"DATA_UPLOAD_MAX_NUMBER_FILES","anchor":"data-upload-max-number-files","children":[]},{"title":"DATABASE_ROUTERS","anchor":"database-routers","children":[]},{"title":"DATE_FORMAT","anchor":"date-format","children":[]},{"title":"DATE_INPUT_FORMATS","anchor":"date-input-formats","children":[]},{"title":"DATETIME_FORMAT","anchor":"datetime-format","children":[]},{"title":"DATETIME_INPUT_FORMATS","anchor":"datetime-input-formats","children":[]},{"title":"DEBUG","anchor":"debug","children":[]},{"title":"DEBUG_PROPAGATE_EXCEPTIONS","anchor":"debug-propagate-exceptions","children":[]},{"title":"DECIMAL_SEPARATOR","anchor":"decimal-separator","children":[]},{"title":"DEFAULT_AUTO_FIELD","anchor":"default-auto-field","children":[]},{"title":"DEFAULT_CHARSET","anchor":"default-charset","children":[]},{"title":"DEFAULT_EXCEPTION_REPORTER","anchor":"default-exception-reporter","children":[]},{"title":"DEFAULT_EXCEPTION_REPORTER_FILTER","anchor":"default-exception-reporter-filter","children":[]},{"title":"DEFAULT_FILE_STORAGE","anchor":"default-file-storage","children":[]},{"title":"DEFAULT_FROM_EMAIL","anchor":"default-from-email","children":[]},{"title":"DEFAULT_INDEX_TABLESPACE","anchor":"default-index-tablespace","children":[]},{"title":"DEFAULT_TABLESPACE","anchor":"default-tablespace","children":[]},{"title":"DISALLOWED_USER_AGENTS","anchor":"disallowed-user-agents","children":[]},{"title":"EMAIL_BACKEND","anchor":"email-backend","children":[]},{"title":"EMAIL_FILE_PATH","anchor":"email-file-path","children":[]},{"title":"EMAIL_HOST","anchor":"email-host","children":[]},{"title":"EMAIL_HOST_PASSWORD","anchor":"email-host-password","children":[]},{"title":"EMAIL_HOST_USER","anchor":"email-host-user","children":[]},{"title":"EMAIL_PORT","anchor":"email-port","children":[]},{"title":"EMAIL_SUBJECT_PREFIX","anchor":"email-subject-prefix","children":[]},{"title":"EMAIL_USE_LOCALTIME","anchor":"email-use-localtime","children":[]},{"title":"EMAIL_USE_TLS","anchor":"email-use-tls","children":[]},{"title":"EMAIL_USE_SSL","anchor":"email-use-ssl","children":[]},{"title":"EMAIL_SSL_CERTFILE","anchor":"email-ssl-certfile","children":[]},{"title":"EMAIL_SSL_KEYFILE","anchor":"email-ssl-keyfile","children":[]},{"title":"EMAIL_TIMEOUT","anchor":"email-timeout","children":[]},{"title":"FILE_UPLOAD_HANDLERS","anchor":"file-upload-handlers","children":[]},{"title":"FILE_UPLOAD_MAX_MEMORY_SIZE","anchor":"file-upload-max-memory-size","children":[]},{"title":"FILE_UPLOAD_DIRECTORY_PERMISSIONS","anchor":"file-upload-directory-permissions","children":[]},{"title":"FILE_UPLOAD_PERMISSIONS","anchor":"file-upload-permissions","children":[]},{"title":"FILE_UPLOAD_TEMP_DIR","anchor":"file-upload-temp-dir","children":[]},{"title":"FIRST_DAY_OF_WEEK","anchor":"first-day-of-week","children":[]},{"title":"FIXTURE_DIRS","anchor":"fixture-dirs","children":[]},{"title":"FORCE_SCRIPT_NAME","anchor":"force-script-name","children":[]},{"title":"FORM_RENDERER","anchor":"form-renderer","children":[]},{"title":"FORMAT_MODULE_PATH","anchor":"format-module-path","children":[]},{"title":"IGNORABLE_404_URLS","anchor":"ignorable-404-urls","children":[]},{"title":"INSTALLED_APPS","anchor":"installed-apps","children":[]},{"title":"INTERNAL_IPS","anchor":"internal-ips","children":[]},{"title":"LANGUAGE_CODE","anchor":"language-code","children":[]},{"title":"LANGUAGE_COOKIE_AGE","anchor":"language-cookie-age","children":[]},{"title":"LANGUAGE_COOKIE_DOMAIN","anchor":"language-cookie-domain","children":[]},{"title":"LANGUAGE_COOKIE_HTTPONLY","anchor":"language-cookie-httponly","children":[]},{"title":"LANGUAGE_COOKIE_NAME","anchor":"language-cookie-name","children":[]},{"title":"LANGUAGE_COOKIE_PATH","anchor":"language-cookie-path","children":[]},{"title":"LANGUAGE_COOKIE_SAMESITE","anchor":"language-cookie-samesite","children":[]},{"title":"LANGUAGE_COOKIE_SECURE","anchor":"language-cookie-secure","children":[]},{"title":"LANGUAGES","anchor":"languages","children":[]},{"title":"LANGUAGES_BIDI","anchor":"languages-bidi","children":[]},{"title":"LOCALE_PATHS","anchor":"locale-paths","children":[]},{"title":"LOGGING","anchor":"logging","children":[]},{"title":"LOGGING_CONFIG","anchor":"logging-config","children":[]},{"title":"MANAGERS","anchor":"managers","children":[]},{"title":"MEDIA_ROOT","anchor":"media-root","children":[]},{"title":"MEDIA_URL","anchor":"media-url","children":[]},{"title":"MIDDLEWARE","anchor":"middleware","children":[]},{"title":"MIGRATION_MODULES","anchor":"migration-modules","children":[]},{"title":"MONTH_DAY_FORMAT","anchor":"month-day-format","children":[]},{"title":"NUMBER_GROUPING","anchor":"number-grouping","children":[]},{"title":"PREPEND_WWW","anchor":"prepend-www","children":[]},{"title":"ROOT_URLCONF","anchor":"root-urlconf","children":[]},{"title":"SECRET_KEY","anchor":"secret-key","children":[]},{"title":"SECRET_KEY_FALLBACKS","anchor":"secret-key-fallbacks","children":[]},{"title":"SECURE_CONTENT_TYPE_NOSNIFF","anchor":"secure-content-type-nosniff","children":[]},{"title":"SECURE_CROSS_ORIGIN_OPENER_POLICY","anchor":"secure-cross-origin-opener-policy","children":[]},{"title":"SECURE_HSTS_INCLUDE_SUBDOMAINS","anchor":"secure-hsts-include-subdomains","children":[]},{"title":"SECURE_HSTS_PRELOAD","anchor":"secure-hsts-preload","children":[]},{"title":"SECURE_HSTS_SECONDS","anchor":"secure-hsts-seconds","children":[]},{"title":"SECURE_PROXY_SSL_HEADER","anchor":"secure-proxy-ssl-header","children":[]},{"title":"SECURE_REDIRECT_EXEMPT","anchor":"secure-redirect-exempt","children":[]},{"title":"SECURE_REFERRER_POLICY","anchor":"secure-referrer-policy","children":[]},{"title":"SECURE_SSL_HOST","anchor":"secure-ssl-host","children":[]},{"title":"SECURE_SSL_REDIRECT","anchor":"secure-ssl-redirect","children":[]},{"title":"SERIALIZATION_MODULES","anchor":"serialization-modules","children":[]},{"title":"SERVER_EMAIL","anchor":"server-email","children":[]},{"title":"SHORT_DATE_FORMAT","anchor":"short-date-format","children":[]},{"title":"SHORT_DATETIME_FORMAT","anchor":"short-datetime-format","children":[]},{"title":"SIGNING_BACKEND","anchor":"signing-backend","children":[]},{"title":"SILENCED_SYSTEM_CHECKS","anchor":"silenced-system-checks","children":[]},{"title":"TEMPLATES","anchor":"templates","children":[{"title":"BACKEND","anchor":"std-setting-TEMPLATES-BACKEND","children":[]},{"title":"NAME","anchor":"std-setting-TEMPLATES-NAME","children":[]},{"title":"DIRS","anchor":"dirs","children":[]},{"title":"APP_DIRS","anchor":"app-dirs","children":[]},{"title":"OPTIONS","anchor":"std-setting-TEMPLATES-OPTIONS","children":[]}]},{"title":"TEST_RUNNER","anchor":"test-runner","children":[]},{"title":"TEST_NON_SERIALIZED_APPS","anchor":"test-non-serialized-apps","children":[]},{"title":"THOUSAND_SEPARATOR","anchor":"thousand-separator","children":[]},{"title":"TIME_FORMAT","anchor":"time-format","children":[]},{"title":"TIME_INPUT_FORMATS","anchor":"time-input-formats","children":[]},{"title":"TIME_ZONE","anchor":"std-setting-TIME_ZONE","children":[]},{"title":"USE_DEPRECATED_PYTZ","anchor":"use-deprecated-pytz","children":[]},{"title":"USE_I18N","anchor":"use-i18n","children":[]},{"title":"USE_L10N","anchor":"use-l10n","children":[]},{"title":"USE_THOUSAND_SEPARATOR","anchor":"use-thousand-separator","children":[]},{"title":"USE_TZ","anchor":"use-tz","children":[]},{"title":"USE_X_FORWARDED_HOST","anchor":"use-x-forwarded-host","children":[]},{"title":"USE_X_FORWARDED_PORT","anchor":"use-x-forwarded-port","children":[]},{"title":"WSGI_APPLICATION","anchor":"wsgi-application","children":[]},{"title":"YEAR_MONTH_FORMAT","anchor":"year-month-format","children":[]},{"title":"X_FRAME_OPTIONS","anchor":"x-frame-options","children":[]}]},{"title":"Auth","anchor":"auth","children":[{"title":"AUTHENTICATION_BACKENDS","anchor":"authentication-backends","children":[]},{"title":"AUTH_USER_MODEL","anchor":"auth-user-model","children":[]},{"title":"LOGIN_REDIRECT_URL","anchor":"login-redirect-url","children":[]},{"title":"LOGIN_URL","anchor":"login-url","children":[]},{"title":"LOGOUT_REDIRECT_URL","anchor":"logout-redirect-url","children":[]},{"title":"PASSWORD_RESET_TIMEOUT","anchor":"password-reset-timeout","children":[]},{"title":"PASSWORD_HASHERS","anchor":"password-hashers","children":[]},{"title":"AUTH_PASSWORD_VALIDATORS","anchor":"auth-password-validators","children":[]}]},{"title":"Messages","anchor":"messages","children":[{"title":"MESSAGE_LEVEL","anchor":"message-level","children":[]},{"title":"MESSAGE_STORAGE","anchor":"message-storage","children":[]},{"title":"MESSAGE_TAGS","anchor":"message-tags","children":[]}]},{"title":"Sessions","anchor":"sessions","children":[{"title":"SESSION_CACHE_ALIAS","anchor":"session-cache-alias","children":[]},{"title":"SESSION_COOKIE_AGE","anchor":"session-cookie-age","children":[]},{"title":"SESSION_COOKIE_DOMAIN","anchor":"session-cookie-domain","children":[]},{"title":"SESSION_COOKIE_HTTPONLY","anchor":"session-cookie-httponly","children":[]},{"title":"SESSION_COOKIE_NAME","anchor":"session-cookie-name","children":[]},{"title":"SESSION_COOKIE_PATH","anchor":"session-cookie-path","children":[]},{"title":"SESSION_COOKIE_SAMESITE","anchor":"session-cookie-samesite","children":[]},{"title":"SESSION_COOKIE_SECURE","anchor":"session-cookie-secure","children":[]},{"title":"SESSION_ENGINE","anchor":"session-engine","children":[]},{"title":"SESSION_EXPIRE_AT_BROWSER_CLOSE","anchor":"session-expire-at-browser-close","children":[]},{"title":"SESSION_FILE_PATH","anchor":"session-file-path","children":[]},{"title":"SESSION_SAVE_EVERY_REQUEST","anchor":"session-save-every-request","children":[]},{"title":"SESSION_SERIALIZER","anchor":"session-serializer","children":[]}]},{"title":"Sites","anchor":"sites","children":[{"title":"SITE_ID","anchor":"site-id","children":[]}]},{"title":"Static Files","anchor":"static-files","children":[{"title":"STATIC_ROOT","anchor":"static-root","children":[]},{"title":"STATIC_URL","anchor":"static-url","children":[]},{"title":"STATICFILES_DIRS","anchor":"staticfiles-dirs","children":[{"title":"Prefixes (optional)","anchor":"prefixes-optional","children":[]}]},{"title":"STATICFILES_STORAGE","anchor":"staticfiles-storage","children":[]},{"title":"STATICFILES_FINDERS","anchor":"staticfiles-finders","children":[]}]},{"title":"Core Settings Topical Index","anchor":"core-settings-topical-index","children":[{"title":"Cache","anchor":"cache","children":[]},{"title":"Database","anchor":"database","children":[]},{"title":"Debugging","anchor":"debugging","children":[]},{"title":"Email","anchor":"email","children":[]},{"title":"Error reporting","anchor":"error-reporting","children":[]},{"title":"File uploads","anchor":"file-uploads","children":[]},{"title":"Forms","anchor":"forms","children":[]},{"title":"Globalization (i18n/l10n)","anchor":"globalization-i18n-l10n","children":[]},{"title":"HTTP","anchor":"http","children":[]},{"title":"Logging","anchor":"id10","children":[]},{"title":"Models","anchor":"models","children":[]},{"title":"Security","anchor":"security","children":[]},{"title":"Serialization","anchor":"serialization","children":[]},{"title":"Templates","anchor":"id11","children":[]},{"title":"Testing","anchor":"testing","children":[]},{"title":"URLs","anchor":"urls","children":[]}]}],"breadcrumbs":[{"docname":"ref/index","title":"API Reference","url":"/it/4.1/ref/"}],"prev":{"docname":"ref/schema-editor","title":"SchemaEditor","url":"/it/4.1/ref/schema-editor/"},"next":{"docname":"ref/signals","title":"Signals","url":"/it/4.1/ref/signals/"},"formats":{"html":"/it/4.1/ref/settings/","markdown":"/it/4.1/ref/settings.md","json":"/it/4.1/ref/settings.json"},"source":"https://github.com/django/django/blob/stable/4.1.x/docs/ref/settings.txt","official":"https://docs.djangoproject.com/it/4.1/ref/settings/","inVersions":["6.1","6.0","5.2","5.1","5.0","4.2","4.1","4.0","3.2"],"inLocales":["en","zh-hans","fr","ja","id","it","pt-br","ko","es","el","pl"]}