settings.txt 96 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313
  1. ========
  2. Settings
  3. ========
  4. .. contents::
  5. :local:
  6. :depth: 1
  7. .. warning::
  8. Be careful when you override settings, especially when the default value
  9. is a non-empty list or dictionary, such as :setting:`MIDDLEWARE_CLASSES`
  10. and :setting:`STATICFILES_FINDERS`. Make sure you keep the components
  11. required by the features of Django you wish to use.
  12. Core settings
  13. =============
  14. Here's a list of settings available in Django core and their default values.
  15. Settings provided by contrib apps are listed below, followed by a topical index
  16. of the core settings. For introductory material, see the :doc:`settings topic
  17. guide </topics/settings>`.
  18. .. setting:: ABSOLUTE_URL_OVERRIDES
  19. ABSOLUTE_URL_OVERRIDES
  20. ----------------------
  21. Default: ``{}`` (Empty dictionary)
  22. A dictionary mapping ``"app_label.model_name"`` strings to functions that take
  23. a model object and return its URL. This is a way of inserting or overriding
  24. ``get_absolute_url()`` methods on a per-installation basis. Example::
  25. ABSOLUTE_URL_OVERRIDES = {
  26. 'blogs.weblog': lambda o: "/blogs/%s/" % o.slug,
  27. 'news.story': lambda o: "/stories/%s/%s/" % (o.pub_year, o.slug),
  28. }
  29. Note that the model name used in this setting should be all lower-case, regardless
  30. of the case of the actual model class name.
  31. .. setting:: ADMINS
  32. ADMINS
  33. ------
  34. Default: ``[]`` (Empty list)
  35. A list of all the people who get code error notifications. When
  36. ``DEBUG=False`` and a view raises an exception, Django will email these people
  37. with the full exception information. Each item in the list should be a tuple
  38. of (Full name, email address). Example::
  39. [('John', 'john@example.com'), ('Mary', 'mary@example.com')]
  40. Note that Django will email *all* of these people whenever an error happens.
  41. See :doc:`/howto/error-reporting` for more information.
  42. .. setting:: ALLOWED_HOSTS
  43. ALLOWED_HOSTS
  44. -------------
  45. Default: ``[]`` (Empty list)
  46. A list of strings representing the host/domain names that this Django site can
  47. serve. This is a security measure to prevent an attacker from poisoning caches
  48. and password reset emails with links to malicious hosts by submitting requests
  49. with a fake HTTP ``Host`` header, which is possible even under many
  50. seemingly-safe web server configurations.
  51. Values in this list can be fully qualified names (e.g. ``'www.example.com'``),
  52. in which case they will be matched against the request's ``Host`` header
  53. exactly (case-insensitive, not including port). A value beginning with a period
  54. can be used as a subdomain wildcard: ``'.example.com'`` will match
  55. ``example.com``, ``www.example.com``, and any other subdomain of
  56. ``example.com``. A value of ``'*'`` will match anything; in this case you are
  57. responsible to provide your own validation of the ``Host`` header (perhaps in a
  58. middleware; if so this middleware must be listed first in
  59. :setting:`MIDDLEWARE_CLASSES`).
  60. Django also allows the `fully qualified domain name (FQDN)`_ of any entries.
  61. Some browsers include a trailing dot in the ``Host`` header which Django
  62. strips when performing host validation.
  63. .. _`fully qualified domain name (FQDN)`: http://en.wikipedia.org/wiki/Fully_qualified_domain_name
  64. If the ``Host`` header (or ``X-Forwarded-Host`` if
  65. :setting:`USE_X_FORWARDED_HOST` is enabled) does not match any value in this
  66. list, the :meth:`django.http.HttpRequest.get_host()` method will raise
  67. :exc:`~django.core.exceptions.SuspiciousOperation`.
  68. When :setting:`DEBUG` is ``True`` or when running tests, host validation is
  69. disabled; any host will be accepted. Thus it's usually only necessary to set it
  70. in production.
  71. This validation only applies via :meth:`~django.http.HttpRequest.get_host()`;
  72. if your code accesses the ``Host`` header directly from ``request.META`` you
  73. are bypassing this security protection.
  74. .. setting:: ALLOWED_INCLUDE_ROOTS
  75. ALLOWED_INCLUDE_ROOTS
  76. ---------------------
  77. Default: ``[]`` (Empty list)
  78. .. deprecated:: 1.8
  79. This setting, along with the :ttag:`ssi` template tag, is deprecated and
  80. will be removed in Django 2.0.
  81. .. versionchanged:: 1.8
  82. You can also set the ``'allowed_include_roots'`` option in the
  83. :setting:`OPTIONS <TEMPLATES-OPTIONS>` of a ``DjangoTemplates`` backend
  84. instead.
  85. A list of strings representing allowed prefixes for the ``{% ssi %}`` template
  86. tag. This is a security measure, so that template authors can't access files
  87. that they shouldn't be accessing.
  88. For example, if :setting:`ALLOWED_INCLUDE_ROOTS` is ``['/home/html', '/var/www']``,
  89. then ``{% ssi /home/html/foo.txt %}`` would work, but ``{% ssi /etc/passwd %}``
  90. wouldn't.
  91. .. setting:: APPEND_SLASH
  92. APPEND_SLASH
  93. ------------
  94. Default: ``True``
  95. When set to ``True``, if the request URL does not match any of the patterns
  96. in the URLconf and it doesn't end in a slash, an HTTP redirect is issued to the
  97. same URL with a slash appended. Note that the redirect may cause any data
  98. submitted in a POST request to be lost.
  99. The :setting:`APPEND_SLASH` setting is only used if
  100. :class:`~django.middleware.common.CommonMiddleware` is installed
  101. (see :doc:`/topics/http/middleware`). See also :setting:`PREPEND_WWW`.
  102. .. setting:: CACHES
  103. CACHES
  104. ------
  105. Default::
  106. {
  107. 'default': {
  108. 'BACKEND': 'django.core.cache.backends.locmem.LocMemCache',
  109. }
  110. }
  111. A dictionary containing the settings for all caches to be used with
  112. Django. It is a nested dictionary whose contents maps cache aliases
  113. to a dictionary containing the options for an individual cache.
  114. The :setting:`CACHES` setting must configure a ``default`` cache;
  115. any number of additional caches may also be specified. If you
  116. are using a cache backend other than the local memory cache, or
  117. you need to define multiple caches, other options will be required.
  118. The following cache options are available.
  119. .. setting:: CACHES-BACKEND
  120. BACKEND
  121. ~~~~~~~
  122. Default: ``''`` (Empty string)
  123. The cache backend to use. The built-in cache backends are:
  124. * ``'django.core.cache.backends.db.DatabaseCache'``
  125. * ``'django.core.cache.backends.dummy.DummyCache'``
  126. * ``'django.core.cache.backends.filebased.FileBasedCache'``
  127. * ``'django.core.cache.backends.locmem.LocMemCache'``
  128. * ``'django.core.cache.backends.memcached.MemcachedCache'``
  129. * ``'django.core.cache.backends.memcached.PyLibMCCache'``
  130. You can use a cache backend that doesn't ship with Django by setting
  131. :setting:`BACKEND <CACHES-BACKEND>` to a fully-qualified path of a cache
  132. backend class (i.e. ``mypackage.backends.whatever.WhateverCache``).
  133. .. setting:: CACHES-KEY_FUNCTION
  134. KEY_FUNCTION
  135. ~~~~~~~~~~~~
  136. A string containing a dotted path to a function (or any callable) that defines how to
  137. compose a prefix, version and key into a final cache key. The default
  138. implementation is equivalent to the function::
  139. def make_key(key, key_prefix, version):
  140. return ':'.join([key_prefix, str(version), key])
  141. You may use any key function you want, as long as it has the same
  142. argument signature.
  143. See the :ref:`cache documentation <cache_key_transformation>` for more
  144. information.
  145. .. setting:: CACHES-KEY_PREFIX
  146. KEY_PREFIX
  147. ~~~~~~~~~~
  148. Default: ``''`` (Empty string)
  149. A string that will be automatically included (prepended by default) to
  150. all cache keys used by the Django server.
  151. See the :ref:`cache documentation <cache_key_prefixing>` for more information.
  152. .. setting:: CACHES-LOCATION
  153. LOCATION
  154. ~~~~~~~~
  155. Default: ``''`` (Empty string)
  156. The location of the cache to use. This might be the directory for a
  157. file system cache, a host and port for a memcache server, or simply an
  158. identifying name for a local memory cache. e.g.::
  159. CACHES = {
  160. 'default': {
  161. 'BACKEND': 'django.core.cache.backends.filebased.FileBasedCache',
  162. 'LOCATION': '/var/tmp/django_cache',
  163. }
  164. }
  165. .. setting:: CACHES-OPTIONS
  166. OPTIONS
  167. ~~~~~~~
  168. Default: None
  169. Extra parameters to pass to the cache backend. Available parameters
  170. vary depending on your cache backend.
  171. Some information on available parameters can be found in the
  172. :doc:`Cache Backends </topics/cache>` documentation. For more information,
  173. consult your backend module's own documentation.
  174. .. setting:: CACHES-TIMEOUT
  175. TIMEOUT
  176. ~~~~~~~
  177. Default: 300
  178. The number of seconds before a cache entry is considered stale. If the value of
  179. this settings is ``None``, cache entries will not expire.
  180. .. setting:: CACHES-VERSION
  181. VERSION
  182. ~~~~~~~
  183. Default: ``1``
  184. The default version number for cache keys generated by the Django server.
  185. See the :ref:`cache documentation <cache_versioning>` for more information.
  186. .. setting:: CACHE_MIDDLEWARE_ALIAS
  187. CACHE_MIDDLEWARE_ALIAS
  188. ----------------------
  189. Default: ``default``
  190. The cache connection to use for the :ref:`cache middleware
  191. <the-per-site-cache>`.
  192. .. setting:: CACHE_MIDDLEWARE_KEY_PREFIX
  193. CACHE_MIDDLEWARE_KEY_PREFIX
  194. ---------------------------
  195. Default: ``''`` (Empty string)
  196. A string which will be prefixed to the cache keys generated by the :ref:`cache
  197. middleware <the-per-site-cache>`. This prefix is combined with the
  198. :setting:`KEY_PREFIX <CACHES-KEY_PREFIX>` setting; it does not replace it.
  199. See :doc:`/topics/cache`.
  200. .. setting:: CACHE_MIDDLEWARE_SECONDS
  201. CACHE_MIDDLEWARE_SECONDS
  202. ------------------------
  203. Default: ``600``
  204. The default number of seconds to cache a page for the :ref:`cache middleware
  205. <the-per-site-cache>`.
  206. See :doc:`/topics/cache`.
  207. .. _settings-csrf:
  208. .. setting:: CSRF_COOKIE_AGE
  209. CSRF_COOKIE_AGE
  210. ---------------
  211. Default: ``31449600`` (1 year, in seconds)
  212. The age of CSRF cookies, in seconds.
  213. The reason for setting a long-lived expiration time is to avoid problems in
  214. the case of a user closing a browser or bookmarking a page and then loading
  215. that page from a browser cache. Without persistent cookies, the form submission
  216. would fail in this case.
  217. Some browsers (specifically Internet Explorer) can disallow the use of
  218. persistent cookies or can have the indexes to the cookie jar corrupted on disk,
  219. thereby causing CSRF protection checks to fail (and sometimes intermittently).
  220. Change this setting to ``None`` to use session-based CSRF cookies, which
  221. keep the cookies in-memory instead of on persistent storage.
  222. .. setting:: CSRF_COOKIE_DOMAIN
  223. CSRF_COOKIE_DOMAIN
  224. ------------------
  225. Default: ``None``
  226. The domain to be used when setting the CSRF cookie. This can be useful for
  227. easily allowing cross-subdomain requests to be excluded from the normal cross
  228. site request forgery protection. It should be set to a string such as
  229. ``".example.com"`` to allow a POST request from a form on one subdomain to be
  230. accepted by a view served from another subdomain.
  231. Please note that the presence of this setting does not imply that Django's CSRF
  232. protection is safe from cross-subdomain attacks by default - please see the
  233. :ref:`CSRF limitations <csrf-limitations>` section.
  234. .. setting:: CSRF_COOKIE_HTTPONLY
  235. CSRF_COOKIE_HTTPONLY
  236. --------------------
  237. Default: ``False``
  238. Whether to use ``HttpOnly`` flag on the CSRF cookie. If this is set to
  239. ``True``, client-side JavaScript will not to be able to access the CSRF cookie.
  240. This can help prevent malicious JavaScript from bypassing CSRF protection. If
  241. you enable this and need to send the value of the CSRF token with Ajax requests,
  242. your JavaScript will need to pull the value from a hidden CSRF token form input
  243. on the page instead of from the cookie.
  244. See :setting:`SESSION_COOKIE_HTTPONLY` for details on ``HttpOnly``.
  245. .. setting:: CSRF_COOKIE_NAME
  246. CSRF_COOKIE_NAME
  247. ----------------
  248. Default: ``'csrftoken'``
  249. The name of the cookie to use for the CSRF authentication token. This can be whatever you
  250. want. See :doc:`/ref/csrf`.
  251. .. setting:: CSRF_COOKIE_PATH
  252. CSRF_COOKIE_PATH
  253. ----------------
  254. Default: ``'/'``
  255. The path set on the CSRF cookie. This should either match the URL path of your
  256. Django installation or be a parent of that path.
  257. This is useful if you have multiple Django instances running under the same
  258. hostname. They can use different cookie paths, and each instance will only see
  259. its own CSRF cookie.
  260. .. setting:: CSRF_COOKIE_SECURE
  261. CSRF_COOKIE_SECURE
  262. ------------------
  263. Default: ``False``
  264. Whether to use a secure cookie for the CSRF cookie. If this is set to ``True``,
  265. the cookie will be marked as "secure," which means browsers may ensure that the
  266. cookie is only sent under an HTTPS connection.
  267. .. setting:: CSRF_FAILURE_VIEW
  268. CSRF_FAILURE_VIEW
  269. -----------------
  270. Default: ``'django.views.csrf.csrf_failure'``
  271. A dotted path to the view function to be used when an incoming request
  272. is rejected by the CSRF protection. The function should have this signature::
  273. def csrf_failure(request, reason="")
  274. where ``reason`` is a short message (intended for developers or logging, not for
  275. end users) indicating the reason the request was rejected. See
  276. :doc:`/ref/csrf`.
  277. .. setting:: CSRF_HEADER_NAME
  278. CSRF_HEADER_NAME
  279. ----------------
  280. .. versionadded:: 1.9
  281. Default: ``'HTTP_X_CSRFTOKEN'``
  282. The name of the request header used for CSRF authentication.
  283. As with other HTTP headers in ``request.META``, the header name received from
  284. the server is normalized by converting all characters to uppercase, replacing
  285. any hyphens with underscores, and adding an ``'HTTP_'`` prefix to the name.
  286. For example, if your client sends a ``'X-XSRF-TOKEN'`` header, the setting
  287. should be ``'HTTP_X_XSRF_TOKEN'``.
  288. .. setting:: DATABASES
  289. DATABASES
  290. ---------
  291. Default: ``{}`` (Empty dictionary)
  292. A dictionary containing the settings for all databases to be used with
  293. Django. It is a nested dictionary whose contents maps database aliases
  294. to a dictionary containing the options for an individual database.
  295. The :setting:`DATABASES` setting must configure a ``default`` database;
  296. any number of additional databases may also be specified.
  297. The simplest possible settings file is for a single-database setup using
  298. SQLite. This can be configured using the following::
  299. DATABASES = {
  300. 'default': {
  301. 'ENGINE': 'django.db.backends.sqlite3',
  302. 'NAME': 'mydatabase',
  303. }
  304. }
  305. When connecting to other database backends, such as MySQL, Oracle, or
  306. PostgreSQL, additional connection parameters will be required. See
  307. the :setting:`ENGINE <DATABASE-ENGINE>` setting below on how to specify
  308. other database types. This example is for PostgreSQL::
  309. DATABASES = {
  310. 'default': {
  311. 'ENGINE': 'django.db.backends.postgresql_psycopg2',
  312. 'NAME': 'mydatabase',
  313. 'USER': 'mydatabaseuser',
  314. 'PASSWORD': 'mypassword',
  315. 'HOST': '127.0.0.1',
  316. 'PORT': '5432',
  317. }
  318. }
  319. The following inner options that may be required for more complex
  320. configurations are available:
  321. .. setting:: DATABASE-ATOMIC_REQUESTS
  322. ATOMIC_REQUESTS
  323. ~~~~~~~~~~~~~~~
  324. Default: ``False``
  325. Set this to ``True`` to wrap each HTTP request in a transaction on this
  326. database. See :ref:`tying-transactions-to-http-requests`.
  327. .. setting:: DATABASE-AUTOCOMMIT
  328. AUTOCOMMIT
  329. ~~~~~~~~~~
  330. Default: ``True``
  331. Set this to ``False`` if you want to :ref:`disable Django's transaction
  332. management <deactivate-transaction-management>` and implement your own.
  333. .. setting:: DATABASE-ENGINE
  334. ENGINE
  335. ~~~~~~
  336. Default: ``''`` (Empty string)
  337. The database backend to use. The built-in database backends are:
  338. * ``'django.db.backends.postgresql_psycopg2'``
  339. * ``'django.db.backends.mysql'``
  340. * ``'django.db.backends.sqlite3'``
  341. * ``'django.db.backends.oracle'``
  342. You can use a database backend that doesn't ship with Django by setting
  343. ``ENGINE`` to a fully-qualified path (i.e.
  344. ``mypackage.backends.whatever``).
  345. .. setting:: HOST
  346. HOST
  347. ~~~~
  348. Default: ``''`` (Empty string)
  349. Which host to use when connecting to the database. An empty string means
  350. localhost. Not used with SQLite.
  351. If this value starts with a forward slash (``'/'``) and you're using MySQL,
  352. MySQL will connect via a Unix socket to the specified socket. For example::
  353. "HOST": '/var/run/mysql'
  354. If you're using MySQL and this value *doesn't* start with a forward slash, then
  355. this value is assumed to be the host.
  356. If you're using PostgreSQL, by default (empty :setting:`HOST`), the connection
  357. to the database is done through UNIX domain sockets ('local' lines in
  358. ``pg_hba.conf``). If your UNIX domain socket is not in the standard location,
  359. use the same value of ``unix_socket_directory`` from ``postgresql.conf``.
  360. If you want to connect through TCP sockets, set :setting:`HOST` to 'localhost'
  361. or '127.0.0.1' ('host' lines in ``pg_hba.conf``).
  362. On Windows, you should always define :setting:`HOST`, as UNIX domain sockets
  363. are not available.
  364. .. setting:: NAME
  365. NAME
  366. ~~~~
  367. Default: ``''`` (Empty string)
  368. The name of the database to use. For SQLite, it's the full path to the database
  369. file. When specifying the path, always use forward slashes, even on Windows
  370. (e.g. ``C:/homes/user/mysite/sqlite3.db``).
  371. .. setting:: CONN_MAX_AGE
  372. CONN_MAX_AGE
  373. ~~~~~~~~~~~~
  374. Default: ``0``
  375. The lifetime of a database connection, in seconds. Use ``0`` to close database
  376. connections at the end of each request — Django's historical behavior — and
  377. ``None`` for unlimited persistent connections.
  378. .. setting:: OPTIONS
  379. OPTIONS
  380. ~~~~~~~
  381. Default: ``{}`` (Empty dictionary)
  382. Extra parameters to use when connecting to the database. Available parameters
  383. vary depending on your database backend.
  384. Some information on available parameters can be found in the
  385. :doc:`Database Backends </ref/databases>` documentation. For more information,
  386. consult your backend module's own documentation.
  387. .. setting:: PASSWORD
  388. PASSWORD
  389. ~~~~~~~~
  390. Default: ``''`` (Empty string)
  391. The password to use when connecting to the database. Not used with SQLite.
  392. .. setting:: PORT
  393. PORT
  394. ~~~~
  395. Default: ``''`` (Empty string)
  396. The port to use when connecting to the database. An empty string means the
  397. default port. Not used with SQLite.
  398. .. setting:: USER
  399. USER
  400. ~~~~
  401. Default: ``''`` (Empty string)
  402. The username to use when connecting to the database. Not used with SQLite.
  403. .. setting:: DATABASE-TEST
  404. TEST
  405. ~~~~
  406. Default: ``{}``
  407. A dictionary of settings for test databases; for more details about the
  408. creation and use of test databases, see :ref:`the-test-database`. The
  409. following entries are available:
  410. .. setting:: TEST_CHARSET
  411. CHARSET
  412. ^^^^^^^
  413. Default: ``None``
  414. The character set encoding used to create the test database. The value of this
  415. string is passed directly through to the database, so its format is
  416. backend-specific.
  417. Supported for the PostgreSQL_ (``postgresql_psycopg2``) and MySQL_ (``mysql``)
  418. backends.
  419. .. _PostgreSQL: http://www.postgresql.org/docs/current/static/multibyte.html
  420. .. _MySQL: http://dev.mysql.com/doc/refman/5.6/en/charset-database.html
  421. .. setting:: TEST_COLLATION
  422. COLLATION
  423. ^^^^^^^^^
  424. Default: ``None``
  425. The collation order to use when creating the test database. This value is
  426. passed directly to the backend, so its format is backend-specific.
  427. Only supported for the ``mysql`` backend (see the `MySQL manual`_ for details).
  428. .. _MySQL manual: MySQL_
  429. .. setting:: TEST_DEPENDENCIES
  430. DEPENDENCIES
  431. ^^^^^^^^^^^^
  432. Default: ``['default']``, for all databases other than ``default``,
  433. which has no dependencies.
  434. The creation-order dependencies of the database. See the documentation
  435. on :ref:`controlling the creation order of test databases
  436. <topics-testing-creation-dependencies>` for details.
  437. .. setting:: TEST_MIRROR
  438. MIRROR
  439. ^^^^^^
  440. Default: ``None``
  441. The alias of the database that this database should mirror during
  442. testing.
  443. This setting exists to allow for testing of primary/replica
  444. (referred to as master/slave by some databases)
  445. configurations of multiple databases. See the documentation on
  446. :ref:`testing primary/replica configurations
  447. <topics-testing-primaryreplica>` for details.
  448. .. setting:: TEST_NAME
  449. NAME
  450. ^^^^
  451. Default: ``None``
  452. The name of database to use when running the test suite.
  453. If the default value (``None``) is used with the SQLite database engine, the
  454. tests will use a memory resident database. For all other database engines the
  455. test database will use the name ``'test_' + DATABASE_NAME``.
  456. See :ref:`the-test-database`.
  457. .. setting:: TEST_SERIALIZE
  458. SERIALIZE
  459. ^^^^^^^^^
  460. Boolean value to control whether or not the default test runner serializes the
  461. database into an in-memory JSON string before running tests (used to restore
  462. the database state between tests if you don't have transactions). You can set
  463. this to ``False`` to speed up creation time if you don't have any test classes
  464. with :ref:`serialized_rollback=True <test-case-serialized-rollback>`.
  465. .. setting:: TEST_CREATE
  466. CREATE_DB
  467. ^^^^^^^^^
  468. Default: ``True``
  469. This is an Oracle-specific setting.
  470. If it is set to ``False``, the test tablespaces won't be automatically created
  471. at the beginning of the tests and dropped at the end.
  472. .. setting:: TEST_USER_CREATE
  473. CREATE_USER
  474. ^^^^^^^^^^^
  475. Default: ``True``
  476. This is an Oracle-specific setting.
  477. If it is set to ``False``, the test user won't be automatically created at the
  478. beginning of the tests and dropped at the end.
  479. .. setting:: TEST_USER
  480. USER
  481. ^^^^
  482. Default: ``None``
  483. This is an Oracle-specific setting.
  484. The username to use when connecting to the Oracle database that will be used
  485. when running tests. If not provided, Django will use ``'test_' + USER``.
  486. .. setting:: TEST_PASSWD
  487. PASSWORD
  488. ^^^^^^^^
  489. Default: ``None``
  490. This is an Oracle-specific setting.
  491. The password to use when connecting to the Oracle database that will be used
  492. when running tests. If not provided, Django will use a hardcoded default value.
  493. .. setting:: TEST_TBLSPACE
  494. TBLSPACE
  495. ^^^^^^^^
  496. Default: ``None``
  497. This is an Oracle-specific setting.
  498. The name of the tablespace that will be used when running tests. If not
  499. provided, Django will use ``'test_' + USER``.
  500. .. versionchanged:: 1.8
  501. Previously Django used ``'test_' + NAME`` if not provided.
  502. .. setting:: TEST_TBLSPACE_TMP
  503. TBLSPACE_TMP
  504. ^^^^^^^^^^^^
  505. Default: ``None``
  506. This is an Oracle-specific setting.
  507. The name of the temporary tablespace that will be used when running tests. If
  508. not provided, Django will use ``'test_' + USER + '_temp'``.
  509. .. versionchanged:: 1.8
  510. Previously Django used ``'test_' + NAME + '_temp'`` if not provided.
  511. .. setting:: DATAFILE
  512. DATAFILE
  513. ^^^^^^^^
  514. .. versionadded:: 1.8
  515. Default: ``None``
  516. This is an Oracle-specific setting.
  517. The name of the datafile to use for the TBLSPACE. If not provided, Django will
  518. use ``TBLSPACE + '.dbf'``.
  519. .. setting:: DATAFILE_TMP
  520. DATAFILE_TMP
  521. ^^^^^^^^^^^^
  522. .. versionadded:: 1.8
  523. Default: ``None``
  524. This is an Oracle-specific setting.
  525. The name of the datafile to use for the TBLSPACE_TMP. If not provided, Django
  526. will use ``TBLSPACE_TMP + '.dbf'``.
  527. .. setting:: DATAFILE_MAXSIZE
  528. DATAFILE_MAXSIZE
  529. ^^^^^^^^^^^^^^^^
  530. .. versionadded:: 1.8
  531. Default: ``'500M'``
  532. .. versionchanged:: 1.8
  533. The previous value was 200M and was not user customizable.
  534. This is an Oracle-specific setting.
  535. The maximum size that the DATAFILE is allowed to grow to.
  536. .. setting:: DATAFILE_TMP_MAXSIZE
  537. DATAFILE_TMP_MAXSIZE
  538. ^^^^^^^^^^^^^^^^^^^^
  539. .. versionadded:: 1.8
  540. Default: ``'500M'``
  541. .. versionchanged:: 1.8
  542. The previous value was 200M and was not user customizable.
  543. This is an Oracle-specific setting.
  544. The maximum size that the DATAFILE_TMP is allowed to grow to.
  545. .. setting:: DATABASE_ROUTERS
  546. DATABASE_ROUTERS
  547. ----------------
  548. Default: ``[]`` (Empty list)
  549. The list of routers that will be used to determine which database
  550. to use when performing a database queries.
  551. See the documentation on :ref:`automatic database routing in multi
  552. database configurations <topics-db-multi-db-routing>`.
  553. .. setting:: DATE_FORMAT
  554. DATE_FORMAT
  555. -----------
  556. Default: ``'N j, Y'`` (e.g. ``Feb. 4, 2003``)
  557. The default formatting to use for displaying date fields in any part of the
  558. system. Note that if :setting:`USE_L10N` is set to ``True``, then the
  559. locale-dictated format has higher precedence and will be applied instead. See
  560. :tfilter:`allowed date format strings <date>`.
  561. See also :setting:`DATETIME_FORMAT`, :setting:`TIME_FORMAT` and :setting:`SHORT_DATE_FORMAT`.
  562. .. setting:: DATE_INPUT_FORMATS
  563. DATE_INPUT_FORMATS
  564. ------------------
  565. Default::
  566. [
  567. '%Y-%m-%d', '%m/%d/%Y', '%m/%d/%y', # '2006-10-25', '10/25/2006', '10/25/06'
  568. '%b %d %Y', '%b %d, %Y', # 'Oct 25 2006', 'Oct 25, 2006'
  569. '%d %b %Y', '%d %b, %Y', # '25 Oct 2006', '25 Oct, 2006'
  570. '%B %d %Y', '%B %d, %Y', # 'October 25 2006', 'October 25, 2006'
  571. '%d %B %Y', '%d %B, %Y', # '25 October 2006', '25 October, 2006'
  572. ]
  573. A list of formats that will be accepted when inputting data on a date field.
  574. Formats will be tried in order, using the first valid one. Note that these
  575. format strings use Python's datetime_ module syntax, not the format strings
  576. from the ``date`` Django template tag.
  577. When :setting:`USE_L10N` is ``True``, the locale-dictated format has higher
  578. precedence and will be applied instead.
  579. See also :setting:`DATETIME_INPUT_FORMATS` and :setting:`TIME_INPUT_FORMATS`.
  580. .. _datetime: https://docs.python.org/library/datetime.html#strftime-strptime-behavior
  581. .. setting:: DATETIME_FORMAT
  582. DATETIME_FORMAT
  583. ---------------
  584. Default: ``'N j, Y, P'`` (e.g. ``Feb. 4, 2003, 4 p.m.``)
  585. The default formatting to use for displaying datetime fields in any part of the
  586. system. Note that if :setting:`USE_L10N` is set to ``True``, then the
  587. locale-dictated format has higher precedence and will be applied instead. See
  588. :tfilter:`allowed date format strings <date>`.
  589. See also :setting:`DATE_FORMAT`, :setting:`TIME_FORMAT` and :setting:`SHORT_DATETIME_FORMAT`.
  590. .. setting:: DATETIME_INPUT_FORMATS
  591. DATETIME_INPUT_FORMATS
  592. ----------------------
  593. Default::
  594. [
  595. '%Y-%m-%d %H:%M:%S', # '2006-10-25 14:30:59'
  596. '%Y-%m-%d %H:%M:%S.%f', # '2006-10-25 14:30:59.000200'
  597. '%Y-%m-%d %H:%M', # '2006-10-25 14:30'
  598. '%Y-%m-%d', # '2006-10-25'
  599. '%m/%d/%Y %H:%M:%S', # '10/25/2006 14:30:59'
  600. '%m/%d/%Y %H:%M:%S.%f', # '10/25/2006 14:30:59.000200'
  601. '%m/%d/%Y %H:%M', # '10/25/2006 14:30'
  602. '%m/%d/%Y', # '10/25/2006'
  603. '%m/%d/%y %H:%M:%S', # '10/25/06 14:30:59'
  604. '%m/%d/%y %H:%M:%S.%f', # '10/25/06 14:30:59.000200'
  605. '%m/%d/%y %H:%M', # '10/25/06 14:30'
  606. '%m/%d/%y', # '10/25/06'
  607. ]
  608. A list of formats that will be accepted when inputting data on a datetime
  609. field. Formats will be tried in order, using the first valid one. Note that
  610. these format strings use Python's datetime_ module syntax, not the format
  611. strings from the ``date`` Django template tag.
  612. When :setting:`USE_L10N` is ``True``, the locale-dictated format has higher
  613. precedence and will be applied instead.
  614. See also :setting:`DATE_INPUT_FORMATS` and :setting:`TIME_INPUT_FORMATS`.
  615. .. _datetime: https://docs.python.org/library/datetime.html#strftime-strptime-behavior
  616. .. setting:: DEBUG
  617. DEBUG
  618. -----
  619. Default: ``False``
  620. A boolean that turns on/off debug mode.
  621. Never deploy a site into production with :setting:`DEBUG` turned on.
  622. Did you catch that? NEVER deploy a site into production with :setting:`DEBUG`
  623. turned on.
  624. One of the main features of debug mode is the display of detailed error pages.
  625. If your app raises an exception when :setting:`DEBUG` is ``True``, Django will
  626. display a detailed traceback, including a lot of metadata about your
  627. environment, such as all the currently defined Django settings (from
  628. ``settings.py``).
  629. As a security measure, Django will *not* include settings that might be
  630. sensitive (or offensive), such as :setting:`SECRET_KEY`. Specifically, it will
  631. exclude any setting whose name includes any of the following:
  632. * ``'API'``
  633. * ``'KEY'``
  634. * ``'PASS'``
  635. * ``'SECRET'``
  636. * ``'SIGNATURE'``
  637. * ``'TOKEN'``
  638. Note that these are *partial* matches. ``'PASS'`` will also match PASSWORD,
  639. just as ``'TOKEN'`` will also match TOKENIZED and so on.
  640. Still, note that there are always going to be sections of your debug output
  641. that are inappropriate for public consumption. File paths, configuration
  642. options and the like all give attackers extra information about your server.
  643. It is also important to remember that when running with :setting:`DEBUG`
  644. turned on, Django will remember every SQL query it executes. This is useful
  645. when you're debugging, but it'll rapidly consume memory on a production server.
  646. Finally, if :setting:`DEBUG` is ``False``, you also need to properly set
  647. the :setting:`ALLOWED_HOSTS` setting. Failing to do so will result in all
  648. requests being returned as "Bad Request (400)".
  649. .. _django/views/debug.py: https://github.com/django/django/blob/master/django/views/debug.py
  650. .. setting:: DEBUG_PROPAGATE_EXCEPTIONS
  651. DEBUG_PROPAGATE_EXCEPTIONS
  652. --------------------------
  653. Default: ``False``
  654. If set to True, Django's normal exception handling of view functions
  655. will be suppressed, and exceptions will propagate upwards. This can
  656. be useful for some test setups, and should never be used on a live
  657. site.
  658. .. setting:: DECIMAL_SEPARATOR
  659. DECIMAL_SEPARATOR
  660. -----------------
  661. Default: ``'.'`` (Dot)
  662. Default decimal separator used when formatting decimal numbers.
  663. Note that if :setting:`USE_L10N` is set to ``True``, then the locale-dictated
  664. format has higher precedence and will be applied instead.
  665. See also :setting:`NUMBER_GROUPING`, :setting:`THOUSAND_SEPARATOR` and
  666. :setting:`USE_THOUSAND_SEPARATOR`.
  667. .. setting:: DEFAULT_CHARSET
  668. DEFAULT_CHARSET
  669. ---------------
  670. Default: ``'utf-8'``
  671. Default charset to use for all ``HttpResponse`` objects, if a MIME type isn't
  672. manually specified. Used with :setting:`DEFAULT_CONTENT_TYPE` to construct the
  673. ``Content-Type`` header.
  674. .. setting:: DEFAULT_CONTENT_TYPE
  675. DEFAULT_CONTENT_TYPE
  676. --------------------
  677. Default: ``'text/html'``
  678. Default content type to use for all ``HttpResponse`` objects, if a MIME type
  679. isn't manually specified. Used with :setting:`DEFAULT_CHARSET` to construct
  680. the ``Content-Type`` header.
  681. .. setting:: DEFAULT_EXCEPTION_REPORTER_FILTER
  682. DEFAULT_EXCEPTION_REPORTER_FILTER
  683. ---------------------------------
  684. Default: :class:`django.views.debug.SafeExceptionReporterFilter`
  685. Default exception reporter filter class to be used if none has been assigned to
  686. the :class:`~django.http.HttpRequest` instance yet.
  687. See :ref:`Filtering error reports<filtering-error-reports>`.
  688. .. setting:: DEFAULT_FILE_STORAGE
  689. DEFAULT_FILE_STORAGE
  690. --------------------
  691. Default: :class:`django.core.files.storage.FileSystemStorage`
  692. Default file storage class to be used for any file-related operations that don't
  693. specify a particular storage system. See :doc:`/topics/files`.
  694. .. setting:: DEFAULT_FROM_EMAIL
  695. DEFAULT_FROM_EMAIL
  696. ------------------
  697. Default: ``'webmaster@localhost'``
  698. Default email address to use for various automated correspondence from the
  699. site manager(s). This doesn't include error messages sent to :setting:`ADMINS`
  700. and :setting:`MANAGERS`; for that, see :setting:`SERVER_EMAIL`.
  701. .. setting:: DEFAULT_INDEX_TABLESPACE
  702. DEFAULT_INDEX_TABLESPACE
  703. ------------------------
  704. Default: ``''`` (Empty string)
  705. Default tablespace to use for indexes on fields that don't specify
  706. one, if the backend supports it (see :doc:`/topics/db/tablespaces`).
  707. .. setting:: DEFAULT_TABLESPACE
  708. DEFAULT_TABLESPACE
  709. ------------------
  710. Default: ``''`` (Empty string)
  711. Default tablespace to use for models that don't specify one, if the
  712. backend supports it (see :doc:`/topics/db/tablespaces`).
  713. .. setting:: DISALLOWED_USER_AGENTS
  714. DISALLOWED_USER_AGENTS
  715. ----------------------
  716. Default: ``[]`` (Empty list)
  717. List of compiled regular expression objects representing User-Agent strings that
  718. are not allowed to visit any page, systemwide. Use this for bad robots/crawlers.
  719. This is only used if ``CommonMiddleware`` is installed (see
  720. :doc:`/topics/http/middleware`).
  721. .. setting:: EMAIL_BACKEND
  722. EMAIL_BACKEND
  723. -------------
  724. Default: ``'django.core.mail.backends.smtp.EmailBackend'``
  725. The backend to use for sending emails. For the list of available backends see
  726. :doc:`/topics/email`.
  727. .. setting:: EMAIL_FILE_PATH
  728. EMAIL_FILE_PATH
  729. ---------------
  730. Default: Not defined
  731. The directory used by the ``file`` email backend to store output files.
  732. .. setting:: EMAIL_HOST
  733. EMAIL_HOST
  734. ----------
  735. Default: ``'localhost'``
  736. The host to use for sending email.
  737. See also :setting:`EMAIL_PORT`.
  738. .. setting:: EMAIL_HOST_PASSWORD
  739. EMAIL_HOST_PASSWORD
  740. -------------------
  741. Default: ``''`` (Empty string)
  742. Password to use for the SMTP server defined in :setting:`EMAIL_HOST`. This
  743. setting is used in conjunction with :setting:`EMAIL_HOST_USER` when
  744. authenticating to the SMTP server. If either of these settings is empty,
  745. Django won't attempt authentication.
  746. See also :setting:`EMAIL_HOST_USER`.
  747. .. setting:: EMAIL_HOST_USER
  748. EMAIL_HOST_USER
  749. ---------------
  750. Default: ``''`` (Empty string)
  751. Username to use for the SMTP server defined in :setting:`EMAIL_HOST`.
  752. If empty, Django won't attempt authentication.
  753. See also :setting:`EMAIL_HOST_PASSWORD`.
  754. .. setting:: EMAIL_PORT
  755. EMAIL_PORT
  756. ----------
  757. Default: ``25``
  758. Port to use for the SMTP server defined in :setting:`EMAIL_HOST`.
  759. .. setting:: EMAIL_SUBJECT_PREFIX
  760. EMAIL_SUBJECT_PREFIX
  761. --------------------
  762. Default: ``'[Django] '``
  763. Subject-line prefix for email messages sent with ``django.core.mail.mail_admins``
  764. or ``django.core.mail.mail_managers``. You'll probably want to include the
  765. trailing space.
  766. .. setting:: EMAIL_USE_TLS
  767. EMAIL_USE_TLS
  768. -------------
  769. Default: ``False``
  770. Whether to use a TLS (secure) connection when talking to the SMTP server.
  771. This is used for explicit TLS connections, generally on port 587. If you are
  772. experiencing hanging connections, see the implicit TLS setting
  773. :setting:`EMAIL_USE_SSL`.
  774. .. setting:: EMAIL_USE_SSL
  775. EMAIL_USE_SSL
  776. -------------
  777. Default: ``False``
  778. Whether to use an implicit TLS (secure) connection when talking to the SMTP
  779. server. In most email documentation this type of TLS connection is referred
  780. to as SSL. It is generally used on port 465. If you are experiencing problems,
  781. see the explicit TLS setting :setting:`EMAIL_USE_TLS`.
  782. Note that :setting:`EMAIL_USE_TLS`/:setting:`EMAIL_USE_SSL` are mutually
  783. exclusive, so only set one of those settings to ``True``.
  784. .. setting:: EMAIL_SSL_CERTFILE
  785. EMAIL_SSL_CERTFILE
  786. ------------------
  787. .. versionadded:: 1.8
  788. Default: ``None``
  789. If :setting:`EMAIL_USE_SSL` or :setting:`EMAIL_USE_TLS` is ``True``, you can
  790. optionally specify the path to a PEM-formatted certificate chain file to use
  791. for the SSL connection.
  792. .. setting:: EMAIL_SSL_KEYFILE
  793. EMAIL_SSL_KEYFILE
  794. -----------------
  795. .. versionadded:: 1.8
  796. Default: ``None``
  797. If :setting:`EMAIL_USE_SSL` or :setting:`EMAIL_USE_TLS` is ``True``, you can
  798. optionally specify the path to a PEM-formatted private key file to use for the
  799. SSL connection.
  800. Note that setting :setting:`EMAIL_SSL_CERTFILE` and :setting:`EMAIL_SSL_KEYFILE`
  801. doesn't result in any certificate checking. They're passed to the underlying SSL
  802. connection. Please refer to the documentation of Python's
  803. :func:`python:ssl.wrap_socket` function for details on how the certificate chain
  804. file and private key file are handled.
  805. .. setting:: EMAIL_TIMEOUT
  806. EMAIL_TIMEOUT
  807. -------------
  808. .. versionadded:: 1.8
  809. Default: ``None``
  810. Specifies a timeout in seconds for blocking operations like the connection
  811. attempt.
  812. .. setting:: FILE_CHARSET
  813. FILE_CHARSET
  814. ------------
  815. Default: ``'utf-8'``
  816. The character encoding used to decode any files read from disk. This includes
  817. template files and initial SQL data files.
  818. .. setting:: FILE_UPLOAD_HANDLERS
  819. FILE_UPLOAD_HANDLERS
  820. --------------------
  821. Default::
  822. ["django.core.files.uploadhandler.MemoryFileUploadHandler",
  823. "django.core.files.uploadhandler.TemporaryFileUploadHandler"]
  824. A list of handlers to use for uploading. Changing this setting allows complete
  825. customization -- even replacement -- of Django's upload process.
  826. See :doc:`/topics/files` for details.
  827. .. setting:: FILE_UPLOAD_MAX_MEMORY_SIZE
  828. FILE_UPLOAD_MAX_MEMORY_SIZE
  829. ---------------------------
  830. Default: ``2621440`` (i.e. 2.5 MB).
  831. The maximum size (in bytes) that an upload will be before it gets streamed to
  832. the file system. See :doc:`/topics/files` for details.
  833. .. setting:: FILE_UPLOAD_DIRECTORY_PERMISSIONS
  834. FILE_UPLOAD_DIRECTORY_PERMISSIONS
  835. ---------------------------------
  836. Default: ``None``
  837. The numeric mode to apply to directories created in the process of uploading
  838. files.
  839. This setting also determines the default permissions for collected static
  840. directories when using the :djadmin:`collectstatic` management command. See
  841. :djadmin:`collectstatic` for details on overriding it.
  842. This value mirrors the functionality and caveats of the
  843. :setting:`FILE_UPLOAD_PERMISSIONS` setting.
  844. .. setting:: FILE_UPLOAD_PERMISSIONS
  845. FILE_UPLOAD_PERMISSIONS
  846. -----------------------
  847. Default: ``None``
  848. The numeric mode (i.e. ``0o644``) to set newly uploaded files to. For
  849. more information about what these modes mean, see the documentation for
  850. :func:`os.chmod`.
  851. If this isn't given or is ``None``, you'll get operating-system
  852. dependent behavior. On most platforms, temporary files will have a mode
  853. of ``0o600``, and files saved from memory will be saved using the
  854. system's standard umask.
  855. For security reasons, these permissions aren't applied to the temporary files
  856. that are stored in :setting:`FILE_UPLOAD_TEMP_DIR`.
  857. This setting also determines the default permissions for collected static files
  858. when using the :djadmin:`collectstatic` management command. See
  859. :djadmin:`collectstatic` for details on overriding it.
  860. .. warning::
  861. **Always prefix the mode with a 0.**
  862. If you're not familiar with file modes, please note that the leading
  863. ``0`` is very important: it indicates an octal number, which is the
  864. way that modes must be specified. If you try to use ``644``, you'll
  865. get totally incorrect behavior.
  866. .. setting:: FILE_UPLOAD_TEMP_DIR
  867. FILE_UPLOAD_TEMP_DIR
  868. --------------------
  869. Default: ``None``
  870. The directory to store data (typically files larger than
  871. :setting:`FILE_UPLOAD_MAX_MEMORY_SIZE`) temporarily while uploading files.
  872. If ``None``, Django will use the standard temporary directory for the operating
  873. system. For example, this will default to ``/tmp`` on \*nix-style operating
  874. systems.
  875. See :doc:`/topics/files` for details.
  876. .. setting:: FIRST_DAY_OF_WEEK
  877. FIRST_DAY_OF_WEEK
  878. -----------------
  879. Default: ``0`` (Sunday)
  880. Number representing the first day of the week. This is especially useful
  881. when displaying a calendar. This value is only used when not using
  882. format internationalization, or when a format cannot be found for the
  883. current locale.
  884. The value must be an integer from 0 to 6, where 0 means Sunday, 1 means
  885. Monday and so on.
  886. .. setting:: FIXTURE_DIRS
  887. FIXTURE_DIRS
  888. -------------
  889. Default: ``[]`` (Empty list)
  890. List of directories searched for fixture files, in addition to the
  891. ``fixtures`` directory of each application, in search order.
  892. Note that these paths should use Unix-style forward slashes, even on Windows.
  893. See :ref:`initial-data-via-fixtures` and :ref:`topics-testing-fixtures`.
  894. .. setting:: FORCE_SCRIPT_NAME
  895. FORCE_SCRIPT_NAME
  896. ------------------
  897. Default: ``None``
  898. If not ``None``, this will be used as the value of the ``SCRIPT_NAME``
  899. environment variable in any HTTP request. This setting can be used to override
  900. the server-provided value of ``SCRIPT_NAME``, which may be a rewritten version
  901. of the preferred value or not supplied at all.
  902. .. setting:: FORMAT_MODULE_PATH
  903. FORMAT_MODULE_PATH
  904. ------------------
  905. Default: ``None``
  906. A full Python path to a Python package that contains format definitions for
  907. project locales. If not ``None``, Django will check for a ``formats.py``
  908. file, under the directory named as the current locale, and will use the
  909. formats defined on this file.
  910. For example, if :setting:`FORMAT_MODULE_PATH` is set to ``mysite.formats``,
  911. and current language is ``en`` (English), Django will expect a directory tree
  912. like::
  913. mysite/
  914. formats/
  915. __init__.py
  916. en/
  917. __init__.py
  918. formats.py
  919. .. versionchanged:: 1.8
  920. You can also set this setting to a list of Python paths, for example::
  921. FORMAT_MODULE_PATH = [
  922. 'mysite.formats',
  923. 'some_app.formats',
  924. ]
  925. When Django searches for a certain format, it will go through all given
  926. Python paths until it finds a module that actually defines the given
  927. format. This means that formats defined in packages farther up in the list
  928. will take precedence over the same formats in packages farther down.
  929. Available formats are :setting:`DATE_FORMAT`, :setting:`TIME_FORMAT`,
  930. :setting:`DATETIME_FORMAT`, :setting:`YEAR_MONTH_FORMAT`,
  931. :setting:`MONTH_DAY_FORMAT`, :setting:`SHORT_DATE_FORMAT`,
  932. :setting:`SHORT_DATETIME_FORMAT`, :setting:`FIRST_DAY_OF_WEEK`,
  933. :setting:`DECIMAL_SEPARATOR`, :setting:`THOUSAND_SEPARATOR` and
  934. :setting:`NUMBER_GROUPING`.
  935. .. setting:: IGNORABLE_404_URLS
  936. IGNORABLE_404_URLS
  937. ------------------
  938. Default: ``[]`` (Empty list)
  939. List of compiled regular expression objects describing URLs that should be
  940. ignored when reporting HTTP 404 errors via email (see
  941. :doc:`/howto/error-reporting`). Regular expressions are matched against
  942. :meth:`request's full paths <django.http.HttpRequest.get_full_path>` (including
  943. query string, if any). Use this if your site does not provide a commonly
  944. requested file such as ``favicon.ico`` or ``robots.txt``, or if it gets
  945. hammered by script kiddies.
  946. This is only used if
  947. :class:`~django.middleware.common.BrokenLinkEmailsMiddleware` is enabled (see
  948. :doc:`/topics/http/middleware`).
  949. .. setting:: INSTALLED_APPS
  950. INSTALLED_APPS
  951. --------------
  952. Default: ``[]`` (Empty list)
  953. A list of strings designating all applications that are enabled in this
  954. Django installation. Each string should be a dotted Python path to:
  955. * an application configuration class, or
  956. * a package containing a application.
  957. :doc:`Learn more about application configurations </ref/applications>`.
  958. .. admonition:: Use the application registry for introspection
  959. Your code should never access :setting:`INSTALLED_APPS` directly. Use
  960. :attr:`django.apps.apps` instead.
  961. .. admonition:: Application names and labels must be unique in
  962. :setting:`INSTALLED_APPS`
  963. Application :attr:`names <django.apps.AppConfig.name>` — the dotted Python
  964. path to the application package — must be unique. There is no way to
  965. include the same application twice, short of duplicating its code under
  966. another name.
  967. Application :attr:`labels <django.apps.AppConfig.label>` — by default the
  968. final part of the name — must be unique too. For example, you can't
  969. include both ``django.contrib.auth`` and ``myproject.auth``. However, you
  970. can relabel an application with a custom configuration that defines a
  971. different :attr:`~django.apps.AppConfig.label`.
  972. These rules apply regardless of whether :setting:`INSTALLED_APPS`
  973. references application configuration classes on application packages.
  974. When several applications provide different versions of the same resource
  975. (template, static file, management command, translation), the application
  976. listed first in :setting:`INSTALLED_APPS` has precedence.
  977. .. setting:: INTERNAL_IPS
  978. INTERNAL_IPS
  979. ------------
  980. Default: ``[]`` (Empty list)
  981. A list of IP addresses, as strings, that:
  982. * See debug comments, when :setting:`DEBUG` is ``True``
  983. * Receive X headers in admindocs if the ``XViewMiddleware`` is installed (see
  984. :doc:`/ref/contrib/admin/admindocs`)
  985. .. setting:: LANGUAGE_CODE
  986. LANGUAGE_CODE
  987. -------------
  988. Default: ``'en-us'``
  989. A string representing the language code for this installation. This should be in
  990. standard :term:`language ID format <language code>`. For example, U.S. English
  991. is ``"en-us"``. See also the `list of language identifiers`_ and
  992. :doc:`/topics/i18n/index`.
  993. :setting:`USE_I18N` must be active for this setting to have any effect.
  994. It serves two purposes:
  995. * If the locale middleware isn't in use, it decides which translation is served
  996. to all users.
  997. * If the locale middleware is active, it provides a fallback language in case the
  998. user's preferred language can't be determined or is not supported by the Web
  999. site. It also provides the fallback translation when a translation for a
  1000. given literal doesn't exist for the user's preferred language.
  1001. .. versionchanged:: 1.8
  1002. The fallback for translation literals was added.
  1003. See :ref:`how-django-discovers-language-preference` for more details.
  1004. .. _list of language identifiers: http://www.i18nguy.com/unicode/language-identifiers.html
  1005. .. setting:: LANGUAGE_COOKIE_AGE
  1006. LANGUAGE_COOKIE_AGE
  1007. -------------------
  1008. Default: ``None`` (expires at browser close)
  1009. The age of the language cookie, in seconds.
  1010. .. setting:: LANGUAGE_COOKIE_DOMAIN
  1011. LANGUAGE_COOKIE_DOMAIN
  1012. ----------------------
  1013. Default: ``None``
  1014. The domain to use for the language cookie. Set this to a string such as
  1015. ``".example.com"`` (note the leading dot!) for cross-domain cookies, or use
  1016. ``None`` for a standard domain cookie.
  1017. Be cautious when updating this setting on a production site. If you update
  1018. this setting to enable cross-domain cookies on a site that previously used
  1019. standard domain cookies, existing user cookies that have the old domain
  1020. will not be updated. This will result in site users being unable to switch
  1021. the language as long as these cookies persist. The only safe and reliable
  1022. option to perform the switch is to change the language cookie name
  1023. permanently (via the :setting:`LANGUAGE_COOKIE_NAME` setting) and to add
  1024. a middleware that copies the value from the old cookie to a new one and then
  1025. deletes the old one.
  1026. .. setting:: LANGUAGE_COOKIE_NAME
  1027. LANGUAGE_COOKIE_NAME
  1028. --------------------
  1029. Default: ``'django_language'``
  1030. The name of the cookie to use for the language cookie. This can be whatever
  1031. you want (but should be different from :setting:`SESSION_COOKIE_NAME`). See
  1032. :doc:`/topics/i18n/index`.
  1033. .. setting:: LANGUAGE_COOKIE_PATH
  1034. LANGUAGE_COOKIE_PATH
  1035. --------------------
  1036. Default: ``/``
  1037. The path set on the language cookie. This should either match the URL path of your
  1038. Django installation or be a parent of that path.
  1039. This is useful if you have multiple Django instances running under the same
  1040. hostname. They can use different cookie paths and each instance will only see
  1041. its own language cookie.
  1042. Be cautious when updating this setting on a production site. If you update this
  1043. setting to use a deeper path than it previously used, existing user cookies that
  1044. have the old path will not be updated. This will result in site users being
  1045. unable to switch the language as long as these cookies persist. The only safe
  1046. and reliable option to perform the switch is to change the language cookie name
  1047. permanently (via the :setting:`LANGUAGE_COOKIE_NAME` setting), and to add
  1048. a middleware that copies the value from the old cookie to a new one and then
  1049. deletes the one.
  1050. .. setting:: LANGUAGES
  1051. LANGUAGES
  1052. ---------
  1053. Default: A list of all available languages. This list is continually growing
  1054. and including a copy here would inevitably become rapidly out of date. You can
  1055. see the current list of translated languages by looking in
  1056. ``django/conf/global_settings.py`` (or view the `online source`_).
  1057. .. _online source: https://github.com/django/django/blob/master/django/conf/global_settings.py
  1058. The list is a list of two-tuples in the format
  1059. (:term:`language code<language code>`, ``language name``) -- for example,
  1060. ``('ja', 'Japanese')``.
  1061. This specifies which languages are available for language selection. See
  1062. :doc:`/topics/i18n/index`.
  1063. Generally, the default value should suffice. Only set this setting if you want
  1064. to restrict language selection to a subset of the Django-provided languages.
  1065. If you define a custom :setting:`LANGUAGES` setting, you can mark the
  1066. language names as translation strings using the
  1067. :func:`~django.utils.translation.ugettext_lazy` function.
  1068. Here's a sample settings file::
  1069. from django.utils.translation import ugettext_lazy as _
  1070. LANGUAGES = [
  1071. ('de', _('German')),
  1072. ('en', _('English')),
  1073. ]
  1074. .. setting:: LOCALE_PATHS
  1075. LOCALE_PATHS
  1076. ------------
  1077. Default: ``[]`` (Empty list)
  1078. A list of directories where Django looks for translation files.
  1079. See :ref:`how-django-discovers-translations`.
  1080. Example::
  1081. LOCALE_PATHS = [
  1082. '/home/www/project/common_files/locale',
  1083. '/var/local/translations/locale',
  1084. ]
  1085. Django will look within each of these paths for the ``<locale_code>/LC_MESSAGES``
  1086. directories containing the actual translation files.
  1087. .. setting:: LOGGING
  1088. LOGGING
  1089. -------
  1090. Default: A logging configuration dictionary.
  1091. A data structure containing configuration information. The contents of
  1092. this data structure will be passed as the argument to the
  1093. configuration method described in :setting:`LOGGING_CONFIG`.
  1094. Among other things, the default logging configuration passes HTTP 500 server
  1095. errors to an email log handler when :setting:`DEBUG` is ``False``. See also
  1096. :ref:`configuring-logging`.
  1097. You can see the default logging configuration by looking in
  1098. ``django/utils/log.py`` (or view the `online source`__).
  1099. __ https://github.com/django/django/blob/master/django/utils/log.py
  1100. .. setting:: LOGGING_CONFIG
  1101. LOGGING_CONFIG
  1102. --------------
  1103. Default: ``'logging.config.dictConfig'``
  1104. A path to a callable that will be used to configure logging in the
  1105. Django project. Points at a instance of Python's `dictConfig`_
  1106. configuration method by default.
  1107. If you set :setting:`LOGGING_CONFIG` to ``None``, the logging
  1108. configuration process will be skipped.
  1109. .. _dictConfig: https://docs.python.org/library/logging.config.html#configuration-dictionary-schema
  1110. .. setting:: MANAGERS
  1111. MANAGERS
  1112. --------
  1113. Default: ``[]`` (Empty list)
  1114. A list in the same format as :setting:`ADMINS` that specifies who should get
  1115. broken link notifications when
  1116. :class:`~django.middleware.common.BrokenLinkEmailsMiddleware` is enabled.
  1117. .. setting:: MEDIA_ROOT
  1118. MEDIA_ROOT
  1119. ----------
  1120. Default: ``''`` (Empty string)
  1121. Absolute filesystem path to the directory that will hold :doc:`user-uploaded
  1122. files </topics/files>`.
  1123. Example: ``"/var/www/example.com/media/"``
  1124. See also :setting:`MEDIA_URL`.
  1125. .. warning::
  1126. :setting:`MEDIA_ROOT` and :setting:`STATIC_ROOT` must have different
  1127. values. Before :setting:`STATIC_ROOT` was introduced, it was common to
  1128. rely or fallback on :setting:`MEDIA_ROOT` to also serve static files;
  1129. however, since this can have serious security implications, there is a
  1130. validation check to prevent it.
  1131. .. setting:: MEDIA_URL
  1132. MEDIA_URL
  1133. ---------
  1134. Default: ``''`` (Empty string)
  1135. URL that handles the media served from :setting:`MEDIA_ROOT`, used
  1136. for :doc:`managing stored files </topics/files>`. It must end in a slash if set
  1137. to a non-empty value. You will need to :ref:`configure these files to be served
  1138. <serving-uploaded-files-in-development>` in both development and production.
  1139. If you want to use ``{{ MEDIA_URL }}`` in your templates, add
  1140. ``'django.template.context_processors.media'`` in the ``'context_processors'``
  1141. option of :setting:`TEMPLATES`.
  1142. Example: ``"http://media.example.com/"``
  1143. .. warning::
  1144. There are security risks if you are accepting uploaded content from
  1145. untrusted users! See the security guide's topic on
  1146. :ref:`user-uploaded-content-security` for mitigation details.
  1147. .. warning::
  1148. :setting:`MEDIA_URL` and :setting:`STATIC_URL` must have different
  1149. values. See :setting:`MEDIA_ROOT` for more details.
  1150. .. setting:: MIDDLEWARE_CLASSES
  1151. MIDDLEWARE_CLASSES
  1152. ------------------
  1153. Default::
  1154. ['django.middleware.common.CommonMiddleware',
  1155. 'django.middleware.csrf.CsrfViewMiddleware']
  1156. A list of middleware classes to use. See :doc:`/topics/http/middleware`.
  1157. .. setting:: MIGRATION_MODULES
  1158. MIGRATION_MODULES
  1159. -----------------
  1160. Default::
  1161. {} # empty dictionary
  1162. A dictionary specifying the package where migration modules can be found on a per-app basis. The default value
  1163. of this setting is an empty dictionary, but the default package name for migration modules is ``migrations``.
  1164. Example::
  1165. {'blog': 'blog.db_migrations'}
  1166. In this case, migrations pertaining to the ``blog`` app will be contained in the ``blog.db_migrations`` package.
  1167. If you provide the ``app_label`` argument, :djadmin:`makemigrations` will
  1168. automatically create the package if it doesn't already exist.
  1169. .. setting:: MONTH_DAY_FORMAT
  1170. MONTH_DAY_FORMAT
  1171. ----------------
  1172. Default: ``'F j'``
  1173. The default formatting to use for date fields on Django admin change-list
  1174. pages -- and, possibly, by other parts of the system -- in cases when only the
  1175. month and day are displayed.
  1176. For example, when a Django admin change-list page is being filtered by a date
  1177. drilldown, the header for a given day displays the day and month. Different
  1178. locales have different formats. For example, U.S. English would say
  1179. "January 1," whereas Spanish might say "1 Enero."
  1180. Note that if :setting:`USE_L10N` is set to ``True``, then the corresponding
  1181. locale-dictated format has higher precedence and will be applied.
  1182. See :tfilter:`allowed date format strings <date>`. See also
  1183. :setting:`DATE_FORMAT`, :setting:`DATETIME_FORMAT`,
  1184. :setting:`TIME_FORMAT` and :setting:`YEAR_MONTH_FORMAT`.
  1185. .. setting:: NUMBER_GROUPING
  1186. NUMBER_GROUPING
  1187. ----------------
  1188. Default: ``0``
  1189. Number of digits grouped together on the integer part of a number.
  1190. Common use is to display a thousand separator. If this setting is ``0``, then
  1191. no grouping will be applied to the number. If this setting is greater than
  1192. ``0``, then :setting:`THOUSAND_SEPARATOR` will be used as the separator between
  1193. those groups.
  1194. Note that if :setting:`USE_L10N` is set to ``True``, then the locale-dictated
  1195. format has higher precedence and will be applied instead.
  1196. See also :setting:`DECIMAL_SEPARATOR`, :setting:`THOUSAND_SEPARATOR` and
  1197. :setting:`USE_THOUSAND_SEPARATOR`.
  1198. .. setting:: PREPEND_WWW
  1199. PREPEND_WWW
  1200. -----------
  1201. Default: ``False``
  1202. Whether to prepend the "www." subdomain to URLs that don't have it. This is only
  1203. used if :class:`~django.middleware.common.CommonMiddleware` is installed
  1204. (see :doc:`/topics/http/middleware`). See also :setting:`APPEND_SLASH`.
  1205. .. setting:: ROOT_URLCONF
  1206. ROOT_URLCONF
  1207. ------------
  1208. Default: Not defined
  1209. A string representing the full Python import path to your root URLconf. For example:
  1210. ``"mydjangoapps.urls"``. Can be overridden on a per-request basis by
  1211. setting the attribute ``urlconf`` on the incoming ``HttpRequest``
  1212. object. See :ref:`how-django-processes-a-request` for details.
  1213. .. setting:: SECRET_KEY
  1214. SECRET_KEY
  1215. ----------
  1216. Default: ``''`` (Empty string)
  1217. A secret key for a particular Django installation. This is used to provide
  1218. :doc:`cryptographic signing </topics/signing>`, and should be set to a unique,
  1219. unpredictable value.
  1220. :djadmin:`django-admin startproject <startproject>` automatically adds a
  1221. randomly-generated ``SECRET_KEY`` to each new project.
  1222. Django will refuse to start if :setting:`SECRET_KEY` is not set.
  1223. .. warning::
  1224. **Keep this value secret.**
  1225. Running Django with a known :setting:`SECRET_KEY` defeats many of Django's
  1226. security protections, and can lead to privilege escalation and remote code
  1227. execution vulnerabilities.
  1228. The secret key is used for:
  1229. * All :doc:`sessions </topics/http/sessions>` if you are using
  1230. any other session backend than ``django.contrib.sessions.backends.cache``,
  1231. or if you use
  1232. :class:`~django.contrib.auth.middleware.SessionAuthenticationMiddleware`
  1233. and are using the default
  1234. :meth:`~django.contrib.auth.models.AbstractBaseUser.get_session_auth_hash()`.
  1235. * All :doc:`messages </ref/contrib/messages>` if you are using
  1236. :class:`~django.contrib.messages.storage.cookie.CookieStorage` or
  1237. :class:`~django.contrib.messages.storage.fallback.FallbackStorage`.
  1238. * All :func:`~django.contrib.auth.views.password_reset` tokens.
  1239. * Any usage of :doc:`cryptographic signing </topics/signing>`, unless a
  1240. different key is provided.
  1241. If you rotate your secret key, all of the above will be invalidated.
  1242. Secret keys are not used for passwords of users and key rotation will not
  1243. affect them.
  1244. .. setting:: SECURE_BROWSER_XSS_FILTER
  1245. SECURE_BROWSER_XSS_FILTER
  1246. -------------------------
  1247. .. versionadded:: 1.8
  1248. Default: ``False``
  1249. If ``True``, the :class:`~django.middleware.security.SecurityMiddleware` sets
  1250. the :ref:`x-xss-protection` header on all responses that do not already have it.
  1251. .. setting:: SECURE_CONTENT_TYPE_NOSNIFF
  1252. SECURE_CONTENT_TYPE_NOSNIFF
  1253. ---------------------------
  1254. .. versionadded:: 1.8
  1255. Default: ``False``
  1256. If ``True``, the :class:`~django.middleware.security.SecurityMiddleware`
  1257. sets the :ref:`x-content-type-options` header on all responses that do not
  1258. already have it.
  1259. .. setting:: SECURE_HSTS_INCLUDE_SUBDOMAINS
  1260. SECURE_HSTS_INCLUDE_SUBDOMAINS
  1261. ------------------------------
  1262. .. versionadded:: 1.8
  1263. Default: ``False``
  1264. If ``True``, the :class:`~django.middleware.security.SecurityMiddleware` adds
  1265. the ``includeSubDomains`` tag to the :ref:`http-strict-transport-security`
  1266. header. It has no effect unless :setting:`SECURE_HSTS_SECONDS` is set to a
  1267. non-zero value.
  1268. .. warning::
  1269. Setting this incorrectly can irreversibly (for some time) break your site.
  1270. Read the :ref:`http-strict-transport-security` documentation first.
  1271. .. setting:: SECURE_HSTS_SECONDS
  1272. SECURE_HSTS_SECONDS
  1273. -------------------
  1274. .. versionadded:: 1.8
  1275. Default: ``0``
  1276. If set to a non-zero integer value, the
  1277. :class:`~django.middleware.security.SecurityMiddleware` sets the
  1278. :ref:`http-strict-transport-security` header on all responses that do not
  1279. already have it.
  1280. .. warning::
  1281. Setting this incorrectly can irreversibly (for some time) break your site.
  1282. Read the :ref:`http-strict-transport-security` documentation first.
  1283. .. setting:: SECURE_PROXY_SSL_HEADER
  1284. SECURE_PROXY_SSL_HEADER
  1285. -----------------------
  1286. Default: ``None``
  1287. A tuple representing a HTTP header/value combination that signifies a request
  1288. is secure. This controls the behavior of the request object's ``is_secure()``
  1289. method.
  1290. This takes some explanation. By default, ``is_secure()`` is able to determine
  1291. whether a request is secure by looking at whether the requested URL uses
  1292. "https://". This is important for Django's CSRF protection, and may be used
  1293. by your own code or third-party apps.
  1294. If your Django app is behind a proxy, though, the proxy may be "swallowing" the
  1295. fact that a request is HTTPS, using a non-HTTPS connection between the proxy
  1296. and Django. In this case, ``is_secure()`` would always return ``False`` -- even
  1297. for requests that were made via HTTPS by the end user.
  1298. In this situation, you'll want to configure your proxy to set a custom HTTP
  1299. header that tells Django whether the request came in via HTTPS, and you'll want
  1300. to set ``SECURE_PROXY_SSL_HEADER`` so that Django knows what header to look
  1301. for.
  1302. You'll need to set a tuple with two elements -- the name of the header to look
  1303. for and the required value. For example::
  1304. SECURE_PROXY_SSL_HEADER = ('HTTP_X_FORWARDED_PROTO', 'https')
  1305. Here, we're telling Django that we trust the ``X-Forwarded-Proto`` header
  1306. that comes from our proxy, and any time its value is ``'https'``, then the
  1307. request is guaranteed to be secure (i.e., it originally came in via HTTPS).
  1308. Obviously, you should *only* set this setting if you control your proxy or
  1309. have some other guarantee that it sets/strips this header appropriately.
  1310. Note that the header needs to be in the format as used by ``request.META`` --
  1311. all caps and likely starting with ``HTTP_``. (Remember, Django automatically
  1312. adds ``'HTTP_'`` to the start of x-header names before making the header
  1313. available in ``request.META``.)
  1314. .. warning::
  1315. **You will probably open security holes in your site if you set this
  1316. without knowing what you're doing. And if you fail to set it when you
  1317. should. Seriously.**
  1318. Make sure ALL of the following are true before setting this (assuming the
  1319. values from the example above):
  1320. * Your Django app is behind a proxy.
  1321. * Your proxy strips the ``X-Forwarded-Proto`` header from all incoming
  1322. requests. In other words, if end users include that header in their
  1323. requests, the proxy will discard it.
  1324. * Your proxy sets the ``X-Forwarded-Proto`` header and sends it to Django,
  1325. but only for requests that originally come in via HTTPS.
  1326. If any of those are not true, you should keep this setting set to ``None``
  1327. and find another way of determining HTTPS, perhaps via custom middleware.
  1328. .. setting:: SECURE_REDIRECT_EXEMPT
  1329. SECURE_REDIRECT_EXEMPT
  1330. ----------------------
  1331. .. versionadded:: 1.8
  1332. Default: ``[]``
  1333. If a URL path matches a regular expression in this list, the request will not be
  1334. redirected to HTTPS. If :setting:`SECURE_SSL_REDIRECT` is ``False``, this
  1335. setting has no effect.
  1336. .. setting:: SECURE_SSL_HOST
  1337. SECURE_SSL_HOST
  1338. ---------------
  1339. .. versionadded:: 1.8
  1340. Default: ``None``
  1341. If a string (e.g. ``secure.example.com``), all SSL redirects will be directed
  1342. to this host rather than the originally-requested host
  1343. (e.g. ``www.example.com``). If :setting:`SECURE_SSL_REDIRECT` is ``False``, this
  1344. setting has no effect.
  1345. .. setting:: SECURE_SSL_REDIRECT
  1346. SECURE_SSL_REDIRECT
  1347. -------------------
  1348. .. versionadded:: 1.8
  1349. Default: ``False``.
  1350. If ``True``, the :class:`~django.middleware.security.SecurityMiddleware`
  1351. :ref:`redirects <ssl-redirect>` all non-HTTPS requests to HTTPS (except for
  1352. those URLs matching a regular expression listed in
  1353. :setting:`SECURE_REDIRECT_EXEMPT`).
  1354. .. note::
  1355. If turning this to ``True`` causes infinite redirects, it probably means
  1356. your site is running behind a proxy and can't tell which requests are secure
  1357. and which are not. Your proxy likely sets a header to indicate secure
  1358. requests; you can correct the problem by finding out what that header is and
  1359. configuring the :setting:`SECURE_PROXY_SSL_HEADER` setting accordingly.
  1360. .. setting:: SERIALIZATION_MODULES
  1361. SERIALIZATION_MODULES
  1362. ---------------------
  1363. Default: Not defined.
  1364. A dictionary of modules containing serializer definitions (provided as
  1365. strings), keyed by a string identifier for that serialization type. For
  1366. example, to define a YAML serializer, use::
  1367. SERIALIZATION_MODULES = {'yaml': 'path.to.yaml_serializer'}
  1368. .. setting:: SERVER_EMAIL
  1369. SERVER_EMAIL
  1370. ------------
  1371. Default: ``'root@localhost'``
  1372. The email address that error messages come from, such as those sent to
  1373. :setting:`ADMINS` and :setting:`MANAGERS`.
  1374. .. admonition:: Why are my emails sent from a different address?
  1375. This address is used only for error messages. It is *not* the address that
  1376. regular email messages sent with :meth:`~django.core.mail.send_mail()`
  1377. come from; for that, see :setting:`DEFAULT_FROM_EMAIL`.
  1378. .. setting:: SHORT_DATE_FORMAT
  1379. SHORT_DATE_FORMAT
  1380. -----------------
  1381. Default: ``m/d/Y`` (e.g. ``12/31/2003``)
  1382. An available formatting that can be used for displaying date fields on
  1383. templates. Note that if :setting:`USE_L10N` is set to ``True``, then the
  1384. corresponding locale-dictated format has higher precedence and will be applied.
  1385. See :tfilter:`allowed date format strings <date>`.
  1386. See also :setting:`DATE_FORMAT` and :setting:`SHORT_DATETIME_FORMAT`.
  1387. .. setting:: SHORT_DATETIME_FORMAT
  1388. SHORT_DATETIME_FORMAT
  1389. ---------------------
  1390. Default: ``m/d/Y P`` (e.g. ``12/31/2003 4 p.m.``)
  1391. An available formatting that can be used for displaying datetime fields on
  1392. templates. Note that if :setting:`USE_L10N` is set to ``True``, then the
  1393. corresponding locale-dictated format has higher precedence and will be applied.
  1394. See :tfilter:`allowed date format strings <date>`.
  1395. See also :setting:`DATE_FORMAT` and :setting:`SHORT_DATE_FORMAT`.
  1396. .. setting:: SIGNING_BACKEND
  1397. SIGNING_BACKEND
  1398. ---------------
  1399. Default: ``'django.core.signing.TimestampSigner'``
  1400. The backend used for signing cookies and other data.
  1401. See also the :doc:`/topics/signing` documentation.
  1402. .. setting:: SILENCED_SYSTEM_CHECKS
  1403. SILENCED_SYSTEM_CHECKS
  1404. ----------------------
  1405. Default: ``[]``
  1406. A list of identifiers of messages generated by the system check framework
  1407. (i.e. ``["models.W001"]``) that you wish to permanently acknowledge and ignore.
  1408. Silenced warnings will no longer be output to the console; silenced errors
  1409. will still be printed, but will not prevent management commands from running.
  1410. See also the :doc:`/ref/checks` documentation.
  1411. .. setting:: TEMPLATES
  1412. TEMPLATES
  1413. ---------
  1414. .. versionadded:: 1.8
  1415. Default:: ``[]`` (Empty list)
  1416. A list containing the settings for all template engines to be used with
  1417. Django. Each item of the list is a dictionary containing the options for an
  1418. individual engine.
  1419. Here's a simple setup that tells the Django template engine to load templates
  1420. from the ``templates`` subdirectories inside installed applications::
  1421. TEMPLATES = [
  1422. {
  1423. 'BACKEND': 'django.template.backends.django.DjangoTemplates',
  1424. 'APP_DIRS': True,
  1425. },
  1426. ]
  1427. The following options are available for all backends.
  1428. .. setting:: TEMPLATES-BACKEND
  1429. BACKEND
  1430. ~~~~~~~
  1431. Default: not defined
  1432. The template backend to use. The built-in template backends are:
  1433. * ``'django.template.backends.django.DjangoTemplates'``
  1434. * ``'django.template.backends.jinja2.Jinja2'``
  1435. You can use a template backend that doesn't ship with Django by setting
  1436. ``BACKEND`` to a fully-qualified path (i.e. ``'mypackage.whatever.Backend'``).
  1437. .. setting:: TEMPLATES-NAME
  1438. NAME
  1439. ~~~~
  1440. Default: see below
  1441. The alias for this particular template engine. It's an identifier that allows
  1442. selecting an engine for rendering. Aliases must be unique across all
  1443. configured template engines.
  1444. It defaults to the name of the module defining the engine class, i.e. the
  1445. next to last piece of :setting:`BACKEND <TEMPLATES-BACKEND>`, when it isn't
  1446. provided. For example if the backend is ``'mypackage.whatever.Backend'`` then
  1447. its default name is ``'whatever'``.
  1448. .. setting:: TEMPLATES-DIRS
  1449. DIRS
  1450. ~~~~
  1451. Default:: ``[]`` (Empty list)
  1452. Directories where the engine should look for template source files, in search
  1453. order.
  1454. .. setting:: TEMPLATES-APP_DIRS
  1455. APP_DIRS
  1456. ~~~~~~~~
  1457. Default:: ``False``
  1458. Whether the engine should look for template source files inside installed
  1459. applications.
  1460. .. setting:: TEMPLATES-OPTIONS
  1461. OPTIONS
  1462. ~~~~~~~
  1463. Default:: ``{}`` (Empty dict)
  1464. Extra parameters to pass to the template backend. Available parameters vary
  1465. depending on the template backend.
  1466. .. setting:: TEMPLATE_CONTEXT_PROCESSORS
  1467. TEMPLATE_CONTEXT_PROCESSORS
  1468. ---------------------------
  1469. Default::
  1470. ["django.contrib.auth.context_processors.auth",
  1471. "django.template.context_processors.debug",
  1472. "django.template.context_processors.i18n",
  1473. "django.template.context_processors.media",
  1474. "django.template.context_processors.static",
  1475. "django.template.context_processors.tz",
  1476. "django.contrib.messages.context_processors.messages"]
  1477. .. deprecated:: 1.8
  1478. Set the ``'context_processors'`` option in the :setting:`OPTIONS
  1479. <TEMPLATES-OPTIONS>` of a ``DjangoTemplates`` backend instead.
  1480. A list of callables that are used to populate the context in ``RequestContext``.
  1481. These callables take a request object as their argument and return a dictionary
  1482. of items to be merged into the context.
  1483. .. versionchanged:: 1.8
  1484. Built-in template context processors were moved from
  1485. ``django.core.context_processors`` to
  1486. ``django.template.context_processors`` in Django 1.8.
  1487. .. setting:: TEMPLATE_DEBUG
  1488. TEMPLATE_DEBUG
  1489. --------------
  1490. Default: ``False``
  1491. .. deprecated:: 1.8
  1492. Set the ``'debug'`` option in the :setting:`OPTIONS <TEMPLATES-OPTIONS>`
  1493. of a ``DjangoTemplates`` backend instead.
  1494. A boolean that turns on/off template debug mode. If this is ``True``, the fancy
  1495. error page will display a detailed report for any exception raised during
  1496. template rendering. This report contains the relevant snippet of the template,
  1497. with the appropriate line highlighted.
  1498. Note that Django only displays fancy error pages if :setting:`DEBUG` is ``True``, so
  1499. you'll want to set that to take advantage of this setting.
  1500. See also :setting:`DEBUG`.
  1501. .. setting:: TEMPLATE_DIRS
  1502. TEMPLATE_DIRS
  1503. -------------
  1504. Default: ``[]`` (Empty list)
  1505. .. deprecated:: 1.8
  1506. Set the :setting:`DIRS <TEMPLATES-DIRS>` option of a ``DjangoTemplates``
  1507. backend instead.
  1508. List of locations of the template source files searched by
  1509. :class:`django.template.loaders.filesystem.Loader`, in search order.
  1510. Note that these paths should use Unix-style forward slashes, even on Windows.
  1511. See :doc:`/ref/templates/language`.
  1512. .. setting:: TEMPLATE_LOADERS
  1513. TEMPLATE_LOADERS
  1514. ----------------
  1515. Default::
  1516. ['django.template.loaders.filesystem.Loader',
  1517. 'django.template.loaders.app_directories.Loader']
  1518. .. deprecated:: 1.8
  1519. Set the ``'loaders'`` option in the :setting:`OPTIONS <TEMPLATES-OPTIONS>`
  1520. of a ``DjangoTemplates`` backend instead.
  1521. A list of template loader classes, specified as strings. Each ``Loader`` class
  1522. knows how to import templates from a particular source. Optionally, a tuple can be
  1523. used instead of a string. The first item in the tuple should be the ``Loader``’s
  1524. module, subsequent items are passed to the ``Loader`` during initialization. See
  1525. :doc:`/ref/templates/api`.
  1526. .. setting:: TEMPLATE_STRING_IF_INVALID
  1527. TEMPLATE_STRING_IF_INVALID
  1528. --------------------------
  1529. Default: ``''`` (Empty string)
  1530. .. deprecated:: 1.8
  1531. Set the ``'string_if_invalid'`` option in the :setting:`OPTIONS
  1532. <TEMPLATES-OPTIONS>` of a ``DjangoTemplates`` backend instead.
  1533. Output, as a string, that the template system should use for invalid (e.g.
  1534. misspelled) variables. See :ref:`invalid-template-variables`.
  1535. .. setting:: TEST_RUNNER
  1536. TEST_RUNNER
  1537. -----------
  1538. Default: ``'django.test.runner.DiscoverRunner'``
  1539. The name of the class to use for starting the test suite. See
  1540. :ref:`other-testing-frameworks`.
  1541. .. setting:: TEST_NON_SERIALIZED_APPS
  1542. TEST_NON_SERIALIZED_APPS
  1543. ------------------------
  1544. Default: ``[]``
  1545. In order to restore the database state between tests for
  1546. ``TransactionTestCase``\s and database backends without transactions, Django
  1547. will :ref:`serialize the contents of all apps <test-case-serialized-rollback>`
  1548. when it starts the test run so it can then reload from that copy before tests
  1549. that need it.
  1550. This slows down the startup time of the test runner; if you have apps that
  1551. you know don't need this feature, you can add their full names in here (e.g.
  1552. ``'django.contrib.contenttypes'``) to exclude them from this serialization
  1553. process.
  1554. .. setting:: THOUSAND_SEPARATOR
  1555. THOUSAND_SEPARATOR
  1556. ------------------
  1557. Default: ``,`` (Comma)
  1558. Default thousand separator used when formatting numbers. This setting is
  1559. used only when :setting:`USE_THOUSAND_SEPARATOR` is ``True`` and
  1560. :setting:`NUMBER_GROUPING` is greater than ``0``.
  1561. Note that if :setting:`USE_L10N` is set to ``True``, then the locale-dictated
  1562. format has higher precedence and will be applied instead.
  1563. See also :setting:`NUMBER_GROUPING`, :setting:`DECIMAL_SEPARATOR` and
  1564. :setting:`USE_THOUSAND_SEPARATOR`.
  1565. .. setting:: TIME_FORMAT
  1566. TIME_FORMAT
  1567. -----------
  1568. Default: ``'P'`` (e.g. ``4 p.m.``)
  1569. The default formatting to use for displaying time fields in any part of the
  1570. system. Note that if :setting:`USE_L10N` is set to ``True``, then the
  1571. locale-dictated format has higher precedence and will be applied instead. See
  1572. :tfilter:`allowed date format strings <date>`.
  1573. See also :setting:`DATE_FORMAT` and :setting:`DATETIME_FORMAT`.
  1574. .. setting:: TIME_INPUT_FORMATS
  1575. TIME_INPUT_FORMATS
  1576. ------------------
  1577. Default::
  1578. [
  1579. '%H:%M:%S', # '14:30:59'
  1580. '%H:%M:%S.%f', # '14:30:59.000200'
  1581. '%H:%M', # '14:30'
  1582. ]
  1583. A list of formats that will be accepted when inputting data on a time field.
  1584. Formats will be tried in order, using the first valid one. Note that these
  1585. format strings use Python's datetime_ module syntax, not the format strings
  1586. from the ``date`` Django template tag.
  1587. When :setting:`USE_L10N` is ``True``, the locale-dictated format has higher
  1588. precedence and will be applied instead.
  1589. See also :setting:`DATE_INPUT_FORMATS` and :setting:`DATETIME_INPUT_FORMATS`.
  1590. .. _datetime: https://docs.python.org/library/datetime.html#strftime-strptime-behavior
  1591. .. setting:: TIME_ZONE
  1592. TIME_ZONE
  1593. ---------
  1594. Default: ``'America/Chicago'``
  1595. A string representing the time zone for this installation, or ``None``. See
  1596. the `list of time zones`_.
  1597. .. note::
  1598. Since Django was first released with the :setting:`TIME_ZONE` set to
  1599. ``'America/Chicago'``, the global setting (used if nothing is defined in
  1600. your project's ``settings.py``) remains ``'America/Chicago'`` for backwards
  1601. compatibility. New project templates default to ``'UTC'``.
  1602. Note that this isn't necessarily the time zone of the server. For example, one
  1603. server may serve multiple Django-powered sites, each with a separate time zone
  1604. setting.
  1605. When :setting:`USE_TZ` is ``False``, this is the time zone in which Django
  1606. will store all datetimes. When :setting:`USE_TZ` is ``True``, this is the
  1607. default time zone that Django will use to display datetimes in templates and
  1608. to interpret datetimes entered in forms.
  1609. Django sets the ``os.environ['TZ']`` variable to the time zone you specify in
  1610. the :setting:`TIME_ZONE` setting. Thus, all your views and models will
  1611. automatically operate in this time zone. However, Django won't set the ``TZ``
  1612. environment variable under the following conditions:
  1613. * If you're using the manual configuration option as described in
  1614. :ref:`manually configuring settings
  1615. <settings-without-django-settings-module>`, or
  1616. * If you specify ``TIME_ZONE = None``. This will cause Django to fall back to
  1617. using the system timezone. However, this is discouraged when :setting:`USE_TZ
  1618. = True <USE_TZ>`, because it makes conversions between local time and UTC
  1619. less reliable.
  1620. If Django doesn't set the ``TZ`` environment variable, it's up to you
  1621. to ensure your processes are running in the correct environment.
  1622. .. note::
  1623. Django cannot reliably use alternate time zones in a Windows environment.
  1624. If you're running Django on Windows, :setting:`TIME_ZONE` must be set to
  1625. match the system time zone.
  1626. .. _list of time zones: http://en.wikipedia.org/wiki/List_of_tz_database_time_zones
  1627. .. _pytz: http://pytz.sourceforge.net/
  1628. .. setting:: USE_ETAGS
  1629. USE_ETAGS
  1630. ---------
  1631. Default: ``False``
  1632. A boolean that specifies whether to output the "Etag" header. This saves
  1633. bandwidth but slows down performance. This is used by the ``CommonMiddleware``
  1634. (see :doc:`/topics/http/middleware`) and in the``Cache Framework``
  1635. (see :doc:`/topics/cache`).
  1636. .. setting:: USE_I18N
  1637. USE_I18N
  1638. --------
  1639. Default: ``True``
  1640. A boolean that specifies whether Django's translation system should be enabled.
  1641. This provides an easy way to turn it off, for performance. If this is set to
  1642. ``False``, Django will make some optimizations so as not to load the
  1643. translation machinery.
  1644. See also :setting:`LANGUAGE_CODE`, :setting:`USE_L10N` and :setting:`USE_TZ`.
  1645. .. setting:: USE_L10N
  1646. USE_L10N
  1647. --------
  1648. Default: ``False``
  1649. A boolean that specifies if localized formatting of data will be enabled by
  1650. default or not. If this is set to ``True``, e.g. Django will display numbers and
  1651. dates using the format of the current locale.
  1652. See also :setting:`LANGUAGE_CODE`, :setting:`USE_I18N` and :setting:`USE_TZ`.
  1653. .. note::
  1654. The default :file:`settings.py` file created by :djadmin:`django-admin
  1655. startproject <startproject>` includes ``USE_L10N = True`` for convenience.
  1656. .. setting:: USE_THOUSAND_SEPARATOR
  1657. USE_THOUSAND_SEPARATOR
  1658. ----------------------
  1659. Default: ``False``
  1660. A boolean that specifies whether to display numbers using a thousand separator.
  1661. When :setting:`USE_L10N` is set to ``True`` and if this is also set to
  1662. ``True``, Django will use the values of :setting:`THOUSAND_SEPARATOR` and
  1663. :setting:`NUMBER_GROUPING` to format numbers.
  1664. See also :setting:`DECIMAL_SEPARATOR`, :setting:`NUMBER_GROUPING` and
  1665. :setting:`THOUSAND_SEPARATOR`.
  1666. .. setting:: USE_TZ
  1667. USE_TZ
  1668. ------
  1669. Default: ``False``
  1670. A boolean that specifies if datetimes will be timezone-aware by default or not.
  1671. If this is set to ``True``, Django will use timezone-aware datetimes internally.
  1672. Otherwise, Django will use naive datetimes in local time.
  1673. See also :setting:`TIME_ZONE`, :setting:`USE_I18N` and :setting:`USE_L10N`.
  1674. .. note::
  1675. The default :file:`settings.py` file created by
  1676. :djadmin:`django-admin startproject <startproject>` includes
  1677. ``USE_TZ = True`` for convenience.
  1678. .. setting:: USE_X_FORWARDED_HOST
  1679. USE_X_FORWARDED_HOST
  1680. --------------------
  1681. Default: ``False``
  1682. A boolean that specifies whether to use the X-Forwarded-Host header in
  1683. preference to the Host header. This should only be enabled if a proxy
  1684. which sets this header is in use.
  1685. .. setting:: WSGI_APPLICATION
  1686. WSGI_APPLICATION
  1687. ----------------
  1688. Default: ``None``
  1689. The full Python path of the WSGI application object that Django's built-in
  1690. servers (e.g. :djadmin:`runserver`) will use. The :djadmin:`django-admin
  1691. startproject <startproject>` management command will create a simple
  1692. ``wsgi.py`` file with an ``application`` callable in it, and point this setting
  1693. to that ``application``.
  1694. If not set, the return value of ``django.core.wsgi.get_wsgi_application()``
  1695. will be used. In this case, the behavior of :djadmin:`runserver` will be
  1696. identical to previous Django versions.
  1697. .. setting:: YEAR_MONTH_FORMAT
  1698. YEAR_MONTH_FORMAT
  1699. -----------------
  1700. Default: ``'F Y'``
  1701. The default formatting to use for date fields on Django admin change-list
  1702. pages -- and, possibly, by other parts of the system -- in cases when only the
  1703. year and month are displayed.
  1704. For example, when a Django admin change-list page is being filtered by a date
  1705. drilldown, the header for a given month displays the month and the year.
  1706. Different locales have different formats. For example, U.S. English would say
  1707. "January 2006," whereas another locale might say "2006/January."
  1708. Note that if :setting:`USE_L10N` is set to ``True``, then the corresponding
  1709. locale-dictated format has higher precedence and will be applied.
  1710. See :tfilter:`allowed date format strings <date>`. See also
  1711. :setting:`DATE_FORMAT`, :setting:`DATETIME_FORMAT`, :setting:`TIME_FORMAT`
  1712. and :setting:`MONTH_DAY_FORMAT`.
  1713. .. setting:: X_FRAME_OPTIONS
  1714. X_FRAME_OPTIONS
  1715. ---------------
  1716. Default: ``'SAMEORIGIN'``
  1717. The default value for the X-Frame-Options header used by
  1718. :class:`~django.middleware.clickjacking.XFrameOptionsMiddleware`. See the
  1719. :doc:`clickjacking protection </ref/clickjacking/>` documentation.
  1720. Auth
  1721. ====
  1722. Settings for :mod:`django.contrib.auth`.
  1723. .. setting:: AUTHENTICATION_BACKENDS
  1724. AUTHENTICATION_BACKENDS
  1725. -----------------------
  1726. Default: ``['django.contrib.auth.backends.ModelBackend']``
  1727. A list of authentication backend classes (as strings) to use when attempting to
  1728. authenticate a user. See the :ref:`authentication backends documentation
  1729. <authentication-backends>` for details.
  1730. .. setting:: AUTH_USER_MODEL
  1731. AUTH_USER_MODEL
  1732. ---------------
  1733. Default: 'auth.User'
  1734. The model to use to represent a User. See :ref:`auth-custom-user`.
  1735. .. warning::
  1736. You cannot change the AUTH_USER_MODEL setting during the lifetime of
  1737. a project (i.e. once you have made and migrated models that depend on it)
  1738. without serious effort. It is intended to be set at the project start,
  1739. and the model it refers to must be available in the first migration of
  1740. the app that it lives in.
  1741. See :ref:`auth-custom-user` for more details.
  1742. .. setting:: LOGIN_REDIRECT_URL
  1743. LOGIN_REDIRECT_URL
  1744. ------------------
  1745. Default: ``'/accounts/profile/'``
  1746. The URL where requests are redirected after login when the
  1747. ``contrib.auth.login`` view gets no ``next`` parameter.
  1748. This is used by the :func:`~django.contrib.auth.decorators.login_required`
  1749. decorator, for example.
  1750. This setting also accepts view function names and :ref:`named URL patterns
  1751. <naming-url-patterns>` which can be used to reduce configuration duplication
  1752. since you don't have to define the URL in two places (``settings`` and URLconf).
  1753. .. setting:: LOGIN_URL
  1754. LOGIN_URL
  1755. ---------
  1756. Default: ``'/accounts/login/'``
  1757. The URL where requests are redirected for login, especially when using the
  1758. :func:`~django.contrib.auth.decorators.login_required` decorator.
  1759. This setting also accepts view function names and :ref:`named URL patterns
  1760. <naming-url-patterns>` which can be used to reduce configuration duplication
  1761. since you don't have to define the URL in two places (``settings`` and URLconf).
  1762. .. setting:: LOGOUT_URL
  1763. LOGOUT_URL
  1764. ----------
  1765. Default: ``'/accounts/logout/'``
  1766. LOGIN_URL counterpart.
  1767. .. setting:: PASSWORD_RESET_TIMEOUT_DAYS
  1768. PASSWORD_RESET_TIMEOUT_DAYS
  1769. ---------------------------
  1770. Default: ``3``
  1771. The number of days a password reset link is valid for. Used by the
  1772. :mod:`django.contrib.auth` password reset mechanism.
  1773. .. setting:: PASSWORD_HASHERS
  1774. PASSWORD_HASHERS
  1775. ----------------
  1776. See :ref:`auth_password_storage`.
  1777. Default::
  1778. ['django.contrib.auth.hashers.PBKDF2PasswordHasher',
  1779. 'django.contrib.auth.hashers.PBKDF2SHA1PasswordHasher',
  1780. 'django.contrib.auth.hashers.BCryptPasswordHasher',
  1781. 'django.contrib.auth.hashers.SHA1PasswordHasher',
  1782. 'django.contrib.auth.hashers.MD5PasswordHasher',
  1783. 'django.contrib.auth.hashers.UnsaltedMD5PasswordHasher',
  1784. 'django.contrib.auth.hashers.CryptPasswordHasher']
  1785. .. _settings-messages:
  1786. Messages
  1787. ========
  1788. Settings for :mod:`django.contrib.messages`.
  1789. .. setting:: MESSAGE_LEVEL
  1790. MESSAGE_LEVEL
  1791. -------------
  1792. Default: ``messages.INFO``
  1793. Sets the minimum message level that will be recorded by the messages
  1794. framework. See :ref:`message levels <message-level>` for more details.
  1795. .. admonition:: Important
  1796. If you override ``MESSAGE_LEVEL`` in your settings file and rely on any of
  1797. the built-in constants, you must import the constants module directly to
  1798. avoid the potential for circular imports, e.g.::
  1799. from django.contrib.messages import constants as message_constants
  1800. MESSAGE_LEVEL = message_constants.DEBUG
  1801. If desired, you may specify the numeric values for the constants directly
  1802. according to the values in the above :ref:`constants table
  1803. <message-level-constants>`.
  1804. .. setting:: MESSAGE_STORAGE
  1805. MESSAGE_STORAGE
  1806. ---------------
  1807. Default: ``'django.contrib.messages.storage.fallback.FallbackStorage'``
  1808. Controls where Django stores message data. Valid values are:
  1809. * ``'django.contrib.messages.storage.fallback.FallbackStorage'``
  1810. * ``'django.contrib.messages.storage.session.SessionStorage'``
  1811. * ``'django.contrib.messages.storage.cookie.CookieStorage'``
  1812. See :ref:`message storage backends <message-storage-backends>` for more details.
  1813. The backends that use cookies --
  1814. :class:`~django.contrib.messages.storage.cookie.CookieStorage` and
  1815. :class:`~django.contrib.messages.storage.fallback.FallbackStorage` --
  1816. use the value of :setting:`SESSION_COOKIE_DOMAIN`, :setting:`SESSION_COOKIE_SECURE`
  1817. and :setting:`SESSION_COOKIE_HTTPONLY` when setting their cookies.
  1818. .. setting:: MESSAGE_TAGS
  1819. MESSAGE_TAGS
  1820. ------------
  1821. Default::
  1822. {messages.DEBUG: 'debug',
  1823. messages.INFO: 'info',
  1824. messages.SUCCESS: 'success',
  1825. messages.WARNING: 'warning',
  1826. messages.ERROR: 'error'}
  1827. This sets the mapping of message level to message tag, which is typically
  1828. rendered as a CSS class in HTML. If you specify a value, it will extend
  1829. the default. This means you only have to specify those values which you need
  1830. to override. See :ref:`message-displaying` above for more details.
  1831. .. admonition:: Important
  1832. If you override ``MESSAGE_TAGS`` in your settings file and rely on any of
  1833. the built-in constants, you must import the ``constants`` module directly to
  1834. avoid the potential for circular imports, e.g.::
  1835. from django.contrib.messages import constants as message_constants
  1836. MESSAGE_TAGS = {message_constants.INFO: ''}
  1837. If desired, you may specify the numeric values for the constants directly
  1838. according to the values in the above :ref:`constants table
  1839. <message-level-constants>`.
  1840. .. _settings-sessions:
  1841. Sessions
  1842. ========
  1843. Settings for :mod:`django.contrib.sessions`.
  1844. .. setting:: SESSION_CACHE_ALIAS
  1845. SESSION_CACHE_ALIAS
  1846. -------------------
  1847. Default: ``default``
  1848. If you're using :ref:`cache-based session storage <cached-sessions-backend>`,
  1849. this selects the cache to use.
  1850. .. setting:: SESSION_COOKIE_AGE
  1851. SESSION_COOKIE_AGE
  1852. ------------------
  1853. Default: ``1209600`` (2 weeks, in seconds)
  1854. The age of session cookies, in seconds.
  1855. .. setting:: SESSION_COOKIE_DOMAIN
  1856. SESSION_COOKIE_DOMAIN
  1857. ---------------------
  1858. Default: ``None``
  1859. The domain to use for session cookies. Set this to a string such as
  1860. ``".example.com"`` (note the leading dot!) for cross-domain cookies, or use
  1861. ``None`` for a standard domain cookie.
  1862. Be cautious when updating this setting on a production site. If you update
  1863. this setting to enable cross-domain cookies on a site that previously used
  1864. standard domain cookies, existing user cookies will be set to the old
  1865. domain. This may result in them being unable to log in as long as these cookies
  1866. persist.
  1867. This setting also affects cookies set by :mod:`django.contrib.messages`.
  1868. .. setting:: SESSION_COOKIE_HTTPONLY
  1869. SESSION_COOKIE_HTTPONLY
  1870. -----------------------
  1871. Default: ``True``
  1872. Whether to use ``HTTPOnly`` flag on the session cookie. If this is set to
  1873. ``True``, client-side JavaScript will not to be able to access the
  1874. session cookie.
  1875. HTTPOnly_ is a flag included in a Set-Cookie HTTP response header. It
  1876. is not part of the :rfc:`2109` standard for cookies, and it isn't honored
  1877. consistently by all browsers. However, when it is honored, it can be a
  1878. useful way to mitigate the risk of client side script accessing the
  1879. protected cookie data.
  1880. Turning it on makes it less trivial for an attacker to escalate a cross-site
  1881. scripting vulnerability into full hijacking of a user's session. There's not
  1882. much excuse for leaving this off, either: if your code depends on reading
  1883. session cookies from Javascript, you're probably doing it wrong.
  1884. .. _HTTPOnly: https://www.owasp.org/index.php/HTTPOnly
  1885. .. setting:: SESSION_COOKIE_NAME
  1886. SESSION_COOKIE_NAME
  1887. -------------------
  1888. Default: ``'sessionid'``
  1889. The name of the cookie to use for sessions. This can be whatever you want (but
  1890. should be different from :setting:`LANGUAGE_COOKIE_NAME`).
  1891. .. setting:: SESSION_COOKIE_PATH
  1892. SESSION_COOKIE_PATH
  1893. -------------------
  1894. Default: ``'/'``
  1895. The path set on the session cookie. This should either match the URL path of your
  1896. Django installation or be parent of that path.
  1897. This is useful if you have multiple Django instances running under the same
  1898. hostname. They can use different cookie paths, and each instance will only see
  1899. its own session cookie.
  1900. .. setting:: SESSION_COOKIE_SECURE
  1901. SESSION_COOKIE_SECURE
  1902. ---------------------
  1903. Default: ``False``
  1904. Whether to use a secure cookie for the session cookie. If this is set to
  1905. ``True``, the cookie will be marked as "secure," which means browsers may
  1906. ensure that the cookie is only sent under an HTTPS connection.
  1907. Since it's trivial for a packet sniffer (e.g. `Firesheep`_) to hijack a user's
  1908. session if the session cookie is sent unencrypted, there's really no good
  1909. excuse to leave this off. It will prevent you from using sessions on insecure
  1910. requests and that's a good thing.
  1911. .. _Firesheep: http://codebutler.com/firesheep
  1912. .. setting:: SESSION_ENGINE
  1913. SESSION_ENGINE
  1914. --------------
  1915. Default: ``django.contrib.sessions.backends.db``
  1916. Controls where Django stores session data. Included engines are:
  1917. * ``'django.contrib.sessions.backends.db'``
  1918. * ``'django.contrib.sessions.backends.file'``
  1919. * ``'django.contrib.sessions.backends.cache'``
  1920. * ``'django.contrib.sessions.backends.cached_db'``
  1921. * ``'django.contrib.sessions.backends.signed_cookies'``
  1922. See :ref:`configuring-sessions` for more details.
  1923. .. setting:: SESSION_EXPIRE_AT_BROWSER_CLOSE
  1924. SESSION_EXPIRE_AT_BROWSER_CLOSE
  1925. -------------------------------
  1926. Default: ``False``
  1927. Whether to expire the session when the user closes their browser. See
  1928. :ref:`browser-length-vs-persistent-sessions`.
  1929. .. setting:: SESSION_FILE_PATH
  1930. SESSION_FILE_PATH
  1931. -----------------
  1932. Default: ``None``
  1933. If you're using file-based session storage, this sets the directory in
  1934. which Django will store session data. When the default value (``None``) is
  1935. used, Django will use the standard temporary directory for the system.
  1936. .. setting:: SESSION_SAVE_EVERY_REQUEST
  1937. SESSION_SAVE_EVERY_REQUEST
  1938. --------------------------
  1939. Default: ``False``
  1940. Whether to save the session data on every request. If this is ``False``
  1941. (default), then the session data will only be saved if it has been modified --
  1942. that is, if any of its dictionary values have been assigned or deleted.
  1943. .. setting:: SESSION_SERIALIZER
  1944. SESSION_SERIALIZER
  1945. ------------------
  1946. Default: ``'django.contrib.sessions.serializers.JSONSerializer'``
  1947. Full import path of a serializer class to use for serializing session data.
  1948. Included serializers are:
  1949. * ``'django.contrib.sessions.serializers.PickleSerializer'``
  1950. * ``'django.contrib.sessions.serializers.JSONSerializer'``
  1951. See :ref:`session_serialization` for details, including a warning regarding
  1952. possible remote code execution when using
  1953. :class:`~django.contrib.sessions.serializers.PickleSerializer`.
  1954. Sites
  1955. =====
  1956. Settings for :mod:`django.contrib.sites`.
  1957. .. setting:: SITE_ID
  1958. SITE_ID
  1959. -------
  1960. Default: Not defined
  1961. The ID, as an integer, of the current site in the ``django_site`` database
  1962. table. This is used so that application data can hook into specific sites
  1963. and a single database can manage content for multiple sites.
  1964. .. _settings-staticfiles:
  1965. Static files
  1966. ============
  1967. Settings for :mod:`django.contrib.staticfiles`.
  1968. .. setting:: STATIC_ROOT
  1969. STATIC_ROOT
  1970. -----------
  1971. Default: ``None``
  1972. The absolute path to the directory where :djadmin:`collectstatic` will collect
  1973. static files for deployment.
  1974. Example: ``"/var/www/example.com/static/"``
  1975. If the :doc:`staticfiles</ref/contrib/staticfiles>` contrib app is enabled
  1976. (default) the :djadmin:`collectstatic` management command will collect static
  1977. files into this directory. See the howto on :doc:`managing static
  1978. files</howto/static-files/index>` for more details about usage.
  1979. .. warning::
  1980. This should be an (initially empty) destination directory for collecting
  1981. your static files from their permanent locations into one directory for
  1982. ease of deployment; it is **not** a place to store your static files
  1983. permanently. You should do that in directories that will be found by
  1984. :doc:`staticfiles</ref/contrib/staticfiles>`’s
  1985. :setting:`finders<STATICFILES_FINDERS>`, which by default, are
  1986. ``'static/'`` app sub-directories and any directories you include in
  1987. :setting:`STATICFILES_DIRS`).
  1988. .. setting:: STATIC_URL
  1989. STATIC_URL
  1990. ----------
  1991. Default: ``None``
  1992. URL to use when referring to static files located in :setting:`STATIC_ROOT`.
  1993. Example: ``"/static/"`` or ``"http://static.example.com/"``
  1994. If not ``None``, this will be used as the base path for
  1995. :ref:`asset definitions<form-asset-paths>` (the ``Media`` class) and the
  1996. :doc:`staticfiles app</ref/contrib/staticfiles>`.
  1997. It must end in a slash if set to a non-empty value.
  1998. You may need to :ref:`configure these files to be served in development
  1999. <serving-static-files-in-development>` and will definitely need to do so
  2000. :doc:`in production </howto/static-files/deployment>`.
  2001. .. setting:: STATICFILES_DIRS
  2002. STATICFILES_DIRS
  2003. ----------------
  2004. Default: ``[]`` (Empty list)
  2005. This setting defines the additional locations the staticfiles app will traverse
  2006. if the ``FileSystemFinder`` finder is enabled, e.g. if you use the
  2007. :djadmin:`collectstatic` or :djadmin:`findstatic` management command or use the
  2008. static file serving view.
  2009. This should be set to a list of strings that contain full paths to
  2010. your additional files directory(ies) e.g.::
  2011. STATICFILES_DIRS = [
  2012. "/home/special.polls.com/polls/static",
  2013. "/home/polls.com/polls/static",
  2014. "/opt/webfiles/common",
  2015. ]
  2016. Note that these paths should use Unix-style forward slashes, even on Windows
  2017. (e.g. ``"C:/Users/user/mysite/extra_static_content"``).
  2018. Prefixes (optional)
  2019. ~~~~~~~~~~~~~~~~~~~
  2020. In case you want to refer to files in one of the locations with an additional
  2021. namespace, you can **optionally** provide a prefix as ``(prefix, path)``
  2022. tuples, e.g.::
  2023. STATICFILES_DIRS = [
  2024. # ...
  2025. ("downloads", "/opt/webfiles/stats"),
  2026. ]
  2027. For example, assuming you have :setting:`STATIC_URL` set to ``'/static/'``, the
  2028. :djadmin:`collectstatic` management command would collect the "stats" files
  2029. in a ``'downloads'`` subdirectory of :setting:`STATIC_ROOT`.
  2030. This would allow you to refer to the local file
  2031. ``'/opt/webfiles/stats/polls_20101022.tar.gz'`` with
  2032. ``'/static/downloads/polls_20101022.tar.gz'`` in your templates, e.g.:
  2033. .. code-block:: html+django
  2034. <a href="{% static "downloads/polls_20101022.tar.gz" %}">
  2035. .. setting:: STATICFILES_STORAGE
  2036. STATICFILES_STORAGE
  2037. -------------------
  2038. Default: ``'django.contrib.staticfiles.storage.StaticFilesStorage'``
  2039. The file storage engine to use when collecting static files with the
  2040. :djadmin:`collectstatic` management command.
  2041. A ready-to-use instance of the storage backend defined in this setting
  2042. can be found at ``django.contrib.staticfiles.storage.staticfiles_storage``.
  2043. For an example, see :ref:`staticfiles-from-cdn`.
  2044. .. setting:: STATICFILES_FINDERS
  2045. STATICFILES_FINDERS
  2046. -------------------
  2047. Default::
  2048. ["django.contrib.staticfiles.finders.FileSystemFinder",
  2049. "django.contrib.staticfiles.finders.AppDirectoriesFinder"]
  2050. The list of finder backends that know how to find static files in
  2051. various locations.
  2052. The default will find files stored in the :setting:`STATICFILES_DIRS` setting
  2053. (using ``django.contrib.staticfiles.finders.FileSystemFinder``) and in a
  2054. ``static`` subdirectory of each app (using
  2055. ``django.contrib.staticfiles.finders.AppDirectoriesFinder``). If multiple
  2056. files with the same name are present, the first file that is found will be
  2057. used.
  2058. One finder is disabled by default:
  2059. ``django.contrib.staticfiles.finders.DefaultStorageFinder``. If added to
  2060. your :setting:`STATICFILES_FINDERS` setting, it will look for static files in
  2061. the default file storage as defined by the :setting:`DEFAULT_FILE_STORAGE`
  2062. setting.
  2063. .. note::
  2064. When using the ``AppDirectoriesFinder`` finder, make sure your apps
  2065. can be found by staticfiles. Simply add the app to the
  2066. :setting:`INSTALLED_APPS` setting of your site.
  2067. Static file finders are currently considered a private interface, and this
  2068. interface is thus undocumented.
  2069. Core Settings Topical Index
  2070. ===========================
  2071. Cache
  2072. -----
  2073. * :setting:`CACHES`
  2074. * :setting:`CACHE_MIDDLEWARE_ALIAS`
  2075. * :setting:`CACHE_MIDDLEWARE_KEY_PREFIX`
  2076. * :setting:`CACHE_MIDDLEWARE_SECONDS`
  2077. Database
  2078. --------
  2079. * :setting:`DATABASES`
  2080. * :setting:`DATABASE_ROUTERS`
  2081. * :setting:`DEFAULT_INDEX_TABLESPACE`
  2082. * :setting:`DEFAULT_TABLESPACE`
  2083. Debugging
  2084. ---------
  2085. * :setting:`DEBUG`
  2086. * :setting:`DEBUG_PROPAGATE_EXCEPTIONS`
  2087. Email
  2088. -----
  2089. * :setting:`ADMINS`
  2090. * :setting:`DEFAULT_CHARSET`
  2091. * :setting:`DEFAULT_FROM_EMAIL`
  2092. * :setting:`EMAIL_BACKEND`
  2093. * :setting:`EMAIL_FILE_PATH`
  2094. * :setting:`EMAIL_HOST`
  2095. * :setting:`EMAIL_HOST_PASSWORD`
  2096. * :setting:`EMAIL_HOST_USER`
  2097. * :setting:`EMAIL_PORT`
  2098. * :setting:`EMAIL_SSL_CERTFILE`
  2099. * :setting:`EMAIL_SSL_KEYFILE`
  2100. * :setting:`EMAIL_SUBJECT_PREFIX`
  2101. * :setting*`EMAIL_TIMEOUT`
  2102. * :setting:`EMAIL_USE_TLS`
  2103. * :setting:`MANAGERS`
  2104. * :setting:`SERVER_EMAIL`
  2105. Error reporting
  2106. ---------------
  2107. * :setting:`DEFAULT_EXCEPTION_REPORTER_FILTER`
  2108. * :setting:`IGNORABLE_404_URLS`
  2109. * :setting:`MANAGERS`
  2110. * :setting:`SILENCED_SYSTEM_CHECKS`
  2111. .. _file-upload-settings:
  2112. File uploads
  2113. ------------
  2114. * :setting:`DEFAULT_FILE_STORAGE`
  2115. * :setting:`FILE_CHARSET`
  2116. * :setting:`FILE_UPLOAD_HANDLERS`
  2117. * :setting:`FILE_UPLOAD_MAX_MEMORY_SIZE`
  2118. * :setting:`FILE_UPLOAD_PERMISSIONS`
  2119. * :setting:`FILE_UPLOAD_TEMP_DIR`
  2120. * :setting:`MEDIA_ROOT`
  2121. * :setting:`MEDIA_URL`
  2122. Globalization (i18n/l10n)
  2123. -------------------------
  2124. * :setting:`DATE_FORMAT`
  2125. * :setting:`DATE_INPUT_FORMATS`
  2126. * :setting:`DATETIME_FORMAT`
  2127. * :setting:`DATETIME_INPUT_FORMATS`
  2128. * :setting:`DECIMAL_SEPARATOR`
  2129. * :setting:`FIRST_DAY_OF_WEEK`
  2130. * :setting:`FORMAT_MODULE_PATH`
  2131. * :setting:`LANGUAGE_CODE`
  2132. * :setting:`LANGUAGE_COOKIE_AGE`
  2133. * :setting:`LANGUAGE_COOKIE_DOMAIN`
  2134. * :setting:`LANGUAGE_COOKIE_NAME`
  2135. * :setting:`LANGUAGE_COOKIE_PATH`
  2136. * :setting:`LANGUAGES`
  2137. * :setting:`LOCALE_PATHS`
  2138. * :setting:`MONTH_DAY_FORMAT`
  2139. * :setting:`NUMBER_GROUPING`
  2140. * :setting:`SHORT_DATE_FORMAT`
  2141. * :setting:`SHORT_DATETIME_FORMAT`
  2142. * :setting:`THOUSAND_SEPARATOR`
  2143. * :setting:`TIME_FORMAT`
  2144. * :setting:`TIME_INPUT_FORMATS`
  2145. * :setting:`TIME_ZONE`
  2146. * :setting:`USE_I18N`
  2147. * :setting:`USE_L10N`
  2148. * :setting:`USE_THOUSAND_SEPARATOR`
  2149. * :setting:`USE_TZ`
  2150. * :setting:`YEAR_MONTH_FORMAT`
  2151. HTTP
  2152. ----
  2153. * :setting:`DEFAULT_CHARSET`
  2154. * :setting:`DEFAULT_CONTENT_TYPE`
  2155. * :setting:`DISALLOWED_USER_AGENTS`
  2156. * :setting:`FORCE_SCRIPT_NAME`
  2157. * :setting:`INTERNAL_IPS`
  2158. * :setting:`MIDDLEWARE_CLASSES`
  2159. * Security
  2160. * :setting:`SECURE_BROWSER_XSS_FILTER`
  2161. * :setting:`SECURE_CONTENT_TYPE_NOSNIFF`
  2162. * :setting:`SECURE_HSTS_INCLUDE_SUBDOMAINS`
  2163. * :setting:`SECURE_HSTS_SECONDS`
  2164. * :setting:`SECURE_PROXY_SSL_HEADER`
  2165. * :setting:`SECURE_REDIRECT_EXEMPT`
  2166. * :setting:`SECURE_SSL_HOST`
  2167. * :setting:`SECURE_SSL_REDIRECT`
  2168. * :setting:`SIGNING_BACKEND`
  2169. * :setting:`USE_ETAGS`
  2170. * :setting:`USE_X_FORWARDED_HOST`
  2171. * :setting:`WSGI_APPLICATION`
  2172. Logging
  2173. -------
  2174. * :setting:`LOGGING`
  2175. * :setting:`LOGGING_CONFIG`
  2176. Models
  2177. ------
  2178. * :setting:`ABSOLUTE_URL_OVERRIDES`
  2179. * :setting:`FIXTURE_DIRS`
  2180. * :setting:`INSTALLED_APPS`
  2181. Security
  2182. --------
  2183. * Cross Site Request Forgery protection
  2184. * :setting:`CSRF_COOKIE_DOMAIN`
  2185. * :setting:`CSRF_COOKIE_NAME`
  2186. * :setting:`CSRF_COOKIE_PATH`
  2187. * :setting:`CSRF_COOKIE_SECURE`
  2188. * :setting:`CSRF_FAILURE_VIEW`
  2189. * :setting:`CSRF_HEADER_NAME`
  2190. * :setting:`SECRET_KEY`
  2191. * :setting:`X_FRAME_OPTIONS`
  2192. Serialization
  2193. -------------
  2194. * :setting:`DEFAULT_CHARSET`
  2195. * :setting:`SERIALIZATION_MODULES`
  2196. Templates
  2197. ---------
  2198. * :setting:`ALLOWED_INCLUDE_ROOTS`
  2199. * :setting:`TEMPLATES`
  2200. * :setting:`TEMPLATE_CONTEXT_PROCESSORS`
  2201. * :setting:`TEMPLATE_DEBUG`
  2202. * :setting:`TEMPLATE_DIRS`
  2203. * :setting:`TEMPLATE_LOADERS`
  2204. * :setting:`TEMPLATE_STRING_IF_INVALID`
  2205. Testing
  2206. -------
  2207. * Database: :setting:`TEST <DATABASE-TEST>`
  2208. * :setting:`TEST_NON_SERIALIZED_APPS`
  2209. * :setting:`TEST_RUNNER`
  2210. URLs
  2211. ----
  2212. * :setting:`APPEND_SLASH`
  2213. * :setting:`PREPEND_WWW`
  2214. * :setting:`ROOT_URLCONF`