settings.txt 99 KB

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