settings.txt 81 KB

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