settings.txt 97 KB

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