settings.txt 76 KB

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