settings.txt 78 KB

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