settings.txt 96 KB

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