settings.txt 64 KB

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