settings.txt 59 KB

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