settings.txt 64 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308
  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 field.
  448. Formats will be tried in order, using the first valid. Note that these format
  449. strings are specified in Python's datetime_ module syntax, that is different
  450. from the one used by Django for formatting dates to be displayed.
  451. When :setting:`USE_L10N` is ``True``, the locale-dictated format has higher
  452. precedence and will be applied instead.
  453. See also :setting:`DATETIME_INPUT_FORMATS` and :setting:`TIME_INPUT_FORMATS`.
  454. .. _datetime: http://docs.python.org/library/datetime.html#strftime-strptime-behavior
  455. .. setting:: DATETIME_FORMAT
  456. DATETIME_FORMAT
  457. ---------------
  458. Default: ``'N j, Y, P'`` (e.g. ``Feb. 4, 2003, 4 p.m.``)
  459. The default formatting to use for displaying datetime fields in any part of the
  460. system. Note that if :setting:`USE_L10N` is set to ``True``, then the
  461. locale-dictated format has higher precedence and will be applied instead. See
  462. :tfilter:`allowed date format strings <date>`.
  463. .. versionchanged:: 1.2
  464. This setting can now be overriden by setting :setting:`USE_L10N` to ``True``.
  465. See also :setting:`DATE_FORMAT`, :setting:`TIME_FORMAT` and :setting:`SHORT_DATETIME_FORMAT`.
  466. .. setting:: DATETIME_INPUT_FORMATS
  467. DATETIME_INPUT_FORMATS
  468. ----------------------
  469. .. versionadded:: 1.2
  470. Default::
  471. ('%Y-%m-%d %H:%M:%S', '%Y-%m-%d %H:%M', '%Y-%m-%d',
  472. '%m/%d/%Y %H:%M:%S', '%m/%d/%Y %H:%M', '%m/%d/%Y',
  473. '%m/%d/%y %H:%M:%S', '%m/%d/%y %H:%M', '%m/%d/%y')
  474. A tuple of formats that will be accepted when inputting data on a datetime
  475. field. Formats will be tried in order, using the first valid. Note that these
  476. format strings are specified in Python's datetime_ module syntax, that is
  477. different from the one used by Django for formatting dates to be displayed.
  478. When :setting:`USE_L10N` is ``True``, the locale-dictated format has higher
  479. precedence and will be applied instead.
  480. See also :setting:`DATE_INPUT_FORMATS` and :setting:`TIME_INPUT_FORMATS`.
  481. .. _datetime: http://docs.python.org/library/datetime.html#strftime-strptime-behavior
  482. .. setting:: DEBUG
  483. DEBUG
  484. -----
  485. Default: ``False``
  486. A boolean that turns on/off debug mode.
  487. Never deploy a site into production with :setting:`DEBUG` turned on.
  488. Did you catch that? NEVER deploy a site into production with :setting:`DEBUG`
  489. turned on.
  490. One of the main features of debug mode is the display of detailed error pages.
  491. If your app raises an exception when ``DEBUG`` is ``True``, Django will display
  492. a detailed traceback, including a lot of metadata about your environment, such
  493. as all the currently defined Django settings (from ``settings.py``).
  494. As a security measure, Django will *not* include settings that might be
  495. sensitive (or offensive), such as ``SECRET_KEY`` or ``PROFANITIES_LIST``.
  496. Specifically, it will exclude any setting whose name includes any of the
  497. following:
  498. * API
  499. * KEY
  500. * PASS
  501. * PROFANITIES_LIST
  502. * SECRET
  503. * SIGNATURE
  504. * TOKEN
  505. .. versionchanged:: 1.4
  506. We changed ``'PASSWORD'`` ``'PASS'``. ``'API'``, ``'TOKEN'`` and ``'KEY'``
  507. were added.
  508. Note that these are *partial* matches. ``'PASS'`` will also match PASSWORD,
  509. just as ``'TOKEN'`` will also match TOKENIZED and so on.
  510. Still, note that there are always going to be sections of your debug output
  511. that are inappropriate for public consumption. File paths, configuration
  512. options and the like all give attackers extra information about your server.
  513. It is also important to remember that when running with :setting:`DEBUG`
  514. turned on, Django will remember every SQL query it executes. This is useful
  515. when you're debugging, but it'll rapidly consume memory on a production server.
  516. .. _django/views/debug.py: http://code.djangoproject.com/browser/django/trunk/django/views/debug.py
  517. DEBUG_PROPAGATE_EXCEPTIONS
  518. --------------------------
  519. Default: ``False``
  520. If set to True, Django's normal exception handling of view functions
  521. will be suppressed, and exceptions will propagate upwards. This can
  522. be useful for some test setups, and should never be used on a live
  523. site.
  524. .. setting:: DECIMAL_SEPARATOR
  525. DECIMAL_SEPARATOR
  526. -----------------
  527. .. versionadded:: 1.2
  528. Default: ``'.'`` (Dot)
  529. Default decimal separator used when formatting decimal numbers.
  530. Note that if :setting:`USE_L10N` is set to ``True``, then the locale-dictated
  531. format has higher precedence and will be applied instead.
  532. See also :setting:`NUMBER_GROUPING`, :setting:`THOUSAND_SEPARATOR` and
  533. :setting:`USE_THOUSAND_SEPARATOR`.
  534. .. setting:: DEFAULT_CHARSET
  535. DEFAULT_CHARSET
  536. ---------------
  537. Default: ``'utf-8'``
  538. Default charset to use for all ``HttpResponse`` objects, if a MIME type isn't
  539. manually specified. Used with :setting:`DEFAULT_CONTENT_TYPE` to construct the
  540. ``Content-Type`` header.
  541. .. setting:: DEFAULT_CONTENT_TYPE
  542. DEFAULT_CONTENT_TYPE
  543. --------------------
  544. Default: ``'text/html'``
  545. Default content type to use for all ``HttpResponse`` objects, if a MIME type
  546. isn't manually specified. Used with :setting:`DEFAULT_CHARSET` to construct
  547. the ``Content-Type`` header.
  548. .. setting:: DEFAULT_EXCEPTION_REPORTER_FILTER
  549. DEFAULT_EXCEPTION_REPORTER_FILTER
  550. ---------------------------------
  551. Default: :class:`django.views.debug.SafeExceptionReporterFilter`
  552. Default exception reporter filter class to be used if none has been assigned to
  553. the :class:`HttpRequest` instance yet.
  554. See :ref:`Filtering error reports<filtering-error-reports>`.
  555. .. setting:: DEFAULT_FILE_STORAGE
  556. DEFAULT_FILE_STORAGE
  557. --------------------
  558. Default: :class:`django.core.files.storage.FileSystemStorage`
  559. Default file storage class to be used for any file-related operations that don't
  560. specify a particular storage system. See :doc:`/topics/files`.
  561. .. setting:: DEFAULT_FROM_EMAIL
  562. DEFAULT_FROM_EMAIL
  563. ------------------
  564. Default: ``'webmaster@localhost'``
  565. Default email address to use for various automated correspondence from the
  566. site manager(s).
  567. .. setting:: DEFAULT_INDEX_TABLESPACE
  568. DEFAULT_INDEX_TABLESPACE
  569. ------------------------
  570. Default: ``''`` (Empty string)
  571. Default tablespace to use for indexes on fields that don't specify
  572. one, if the backend supports it (see :doc:`/topics/db/tablespaces`).
  573. .. setting:: DEFAULT_TABLESPACE
  574. DEFAULT_TABLESPACE
  575. ------------------
  576. Default: ``''`` (Empty string)
  577. Default tablespace to use for models that don't specify one, if the
  578. backend supports it (see :doc:`/topics/db/tablespaces`).
  579. .. setting:: DISALLOWED_USER_AGENTS
  580. DISALLOWED_USER_AGENTS
  581. ----------------------
  582. Default: ``()`` (Empty tuple)
  583. List of compiled regular expression objects representing User-Agent strings that
  584. are not allowed to visit any page, systemwide. Use this for bad robots/crawlers.
  585. This is only used if ``CommonMiddleware`` is installed (see
  586. :doc:`/topics/http/middleware`).
  587. .. setting:: EMAIL_BACKEND
  588. EMAIL_BACKEND
  589. -------------
  590. .. versionadded:: 1.2
  591. Default: ``'django.core.mail.backends.smtp.EmailBackend'``
  592. The backend to use for sending emails. For the list of available backends see
  593. :doc:`/topics/email`.
  594. .. setting:: EMAIL_FILE_PATH
  595. EMAIL_FILE_PATH
  596. ---------------
  597. .. versionadded:: 1.2
  598. Default: Not defined
  599. The directory used by the ``file`` email backend to store output files.
  600. .. setting:: EMAIL_HOST
  601. EMAIL_HOST
  602. ----------
  603. Default: ``'localhost'``
  604. The host to use for sending email.
  605. See also :setting:`EMAIL_PORT`.
  606. .. setting:: EMAIL_HOST_PASSWORD
  607. EMAIL_HOST_PASSWORD
  608. -------------------
  609. Default: ``''`` (Empty string)
  610. Password to use for the SMTP server defined in :setting:`EMAIL_HOST`. This
  611. setting is used in conjunction with :setting:`EMAIL_HOST_USER` when
  612. authenticating to the SMTP server. If either of these settings is empty,
  613. Django won't attempt authentication.
  614. See also :setting:`EMAIL_HOST_USER`.
  615. .. setting:: EMAIL_HOST_USER
  616. EMAIL_HOST_USER
  617. ---------------
  618. Default: ``''`` (Empty string)
  619. Username to use for the SMTP server defined in :setting:`EMAIL_HOST`.
  620. If empty, Django won't attempt authentication.
  621. See also :setting:`EMAIL_HOST_PASSWORD`.
  622. .. setting:: EMAIL_PORT
  623. EMAIL_PORT
  624. ----------
  625. Default: ``25``
  626. Port to use for the SMTP server defined in :setting:`EMAIL_HOST`.
  627. .. setting:: EMAIL_SUBJECT_PREFIX
  628. EMAIL_SUBJECT_PREFIX
  629. --------------------
  630. Default: ``'[Django] '``
  631. Subject-line prefix for email messages sent with ``django.core.mail.mail_admins``
  632. or ``django.core.mail.mail_managers``. You'll probably want to include the
  633. trailing space.
  634. .. setting:: EMAIL_USE_TLS
  635. EMAIL_USE_TLS
  636. -------------
  637. Default: ``False``
  638. Whether to use a TLS (secure) connection when talking to the SMTP server.
  639. .. setting:: FILE_CHARSET
  640. FILE_CHARSET
  641. ------------
  642. Default: ``'utf-8'``
  643. The character encoding used to decode any files read from disk. This includes
  644. template files and initial SQL data files.
  645. .. setting:: FILE_UPLOAD_HANDLERS
  646. FILE_UPLOAD_HANDLERS
  647. --------------------
  648. Default::
  649. ("django.core.files.uploadhandler.MemoryFileUploadHandler",
  650. "django.core.files.uploadhandler.TemporaryFileUploadHandler",)
  651. A tuple of handlers to use for uploading. See :doc:`/topics/files` for details.
  652. .. setting:: FILE_UPLOAD_MAX_MEMORY_SIZE
  653. FILE_UPLOAD_MAX_MEMORY_SIZE
  654. ---------------------------
  655. Default: ``2621440`` (i.e. 2.5 MB).
  656. The maximum size (in bytes) that an upload will be before it gets streamed to
  657. the file system. See :doc:`/topics/files` for details.
  658. .. setting:: FILE_UPLOAD_PERMISSIONS
  659. FILE_UPLOAD_PERMISSIONS
  660. -----------------------
  661. Default: ``None``
  662. The numeric mode (i.e. ``0644``) to set newly uploaded files to. For
  663. more information about what these modes mean, see the documentation for
  664. :func:`os.chmod`.
  665. If this isn't given or is ``None``, you'll get operating-system
  666. dependent behavior. On most platforms, temporary files will have a mode
  667. of ``0600``, and files saved from memory will be saved using the
  668. system's standard umask.
  669. .. warning::
  670. **Always prefix the mode with a 0.**
  671. If you're not familiar with file modes, please note that the leading
  672. ``0`` is very important: it indicates an octal number, which is the
  673. way that modes must be specified. If you try to use ``644``, you'll
  674. get totally incorrect behavior.
  675. .. setting:: FILE_UPLOAD_TEMP_DIR
  676. FILE_UPLOAD_TEMP_DIR
  677. --------------------
  678. Default: ``None``
  679. The directory to store data temporarily while uploading files. If ``None``,
  680. Django will use the standard temporary directory for the operating system. For
  681. example, this will default to '/tmp' on \*nix-style operating systems.
  682. See :doc:`/topics/files` for details.
  683. .. setting:: FIRST_DAY_OF_WEEK
  684. FIRST_DAY_OF_WEEK
  685. -----------------
  686. .. versionadded:: 1.2
  687. Default: ``0`` (Sunday)
  688. Number representing the first day of the week. This is especially useful
  689. when displaying a calendar. This value is only used when not using
  690. format internationalization, or when a format cannot be found for the
  691. current locale.
  692. The value must be an integer from 0 to 6, where 0 means Sunday, 1 means
  693. Monday and so on.
  694. .. setting:: FIXTURE_DIRS
  695. FIXTURE_DIRS
  696. -------------
  697. Default: ``()`` (Empty tuple)
  698. List of directories searched for fixture files, in addition to the
  699. ``fixtures`` directory of each application, in search order.
  700. Note that these paths should use Unix-style forward slashes, even on Windows.
  701. See :ref:`initial-data-via-fixtures` and :ref:`topics-testing-fixtures`.
  702. FORCE_SCRIPT_NAME
  703. ------------------
  704. Default: ``None``
  705. If not ``None``, this will be used as the value of the ``SCRIPT_NAME``
  706. environment variable in any HTTP request. This setting can be used to override
  707. the server-provided value of ``SCRIPT_NAME``, which may be a rewritten version
  708. of the preferred value or not supplied at all.
  709. .. setting:: FORMAT_MODULE_PATH
  710. FORMAT_MODULE_PATH
  711. ------------------
  712. .. versionadded:: 1.2
  713. Default: ``None``
  714. A full Python path to a Python package that contains format definitions for
  715. project locales. If not ``None``, Django will check for a ``formats.py``
  716. file, under the directory named as the current locale, and will use the
  717. formats defined on this file.
  718. For example, if :setting:`FORMAT_MODULE_PATH` is set to ``mysite.formats``,
  719. and current language is ``en`` (English), Django will expect a directory tree
  720. like::
  721. mysite/
  722. formats/
  723. __init__.py
  724. en/
  725. __init__.py
  726. formats.py
  727. Available formats are :setting:`DATE_FORMAT`, :setting:`TIME_FORMAT`,
  728. :setting:`DATETIME_FORMAT`, :setting:`YEAR_MONTH_FORMAT`,
  729. :setting:`MONTH_DAY_FORMAT`, :setting:`SHORT_DATE_FORMAT`,
  730. :setting:`SHORT_DATETIME_FORMAT`, :setting:`FIRST_DAY_OF_WEEK`,
  731. :setting:`DECIMAL_SEPARATOR`, :setting:`THOUSAND_SEPARATOR` and
  732. :setting:`NUMBER_GROUPING`.
  733. .. setting:: IGNORABLE_404_URLS
  734. IGNORABLE_404_URLS
  735. ------------------
  736. .. versionadded:: 1.4
  737. Default: ``()``
  738. List of compiled regular expression objects describing URLs that should be
  739. ignored when reporting HTTP 404 errors via email (see
  740. :doc:`/howto/error-reporting`). Use this if your site does not provide a
  741. commonly requested file such as ``favicon.ico`` or ``robots.txt``, or if it
  742. gets hammered by script kiddies.
  743. This is only used if :setting:`SEND_BROKEN_LINK_EMAILS` is set to ``True`` and
  744. ``CommonMiddleware`` is installed (see :doc:`/topics/http/middleware`).
  745. .. setting:: INSTALLED_APPS
  746. INSTALLED_APPS
  747. --------------
  748. Default: ``()`` (Empty tuple)
  749. A tuple of strings designating all applications that are enabled in this Django
  750. installation. Each string should be a full Python path to a Python package that
  751. contains a Django application, as created by :djadmin:`django-admin.py startapp
  752. <startapp>`.
  753. .. admonition:: App names must be unique
  754. The application names (that is, the final dotted part of the
  755. path to the module containing ``models.py``) defined in
  756. :setting:`INSTALLED_APPS` *must* be unique. For example, you can't
  757. include both ``django.contrib.auth`` and ``myproject.auth`` in
  758. INSTALLED_APPS.
  759. .. setting:: INTERNAL_IPS
  760. INTERNAL_IPS
  761. ------------
  762. Default: ``()`` (Empty tuple)
  763. A tuple of IP addresses, as strings, that:
  764. * See debug comments, when :setting:`DEBUG` is ``True``
  765. * Receive X headers if the ``XViewMiddleware`` is installed (see
  766. :doc:`/topics/http/middleware`)
  767. .. setting:: LANGUAGE_CODE
  768. LANGUAGE_CODE
  769. -------------
  770. Default: ``'en-us'``
  771. A string representing the language code for this installation. This should be in
  772. standard :term:`language format<language code>`. For example, U.S. English is
  773. ``"en-us"``. See :doc:`/topics/i18n/index`.
  774. .. setting:: LANGUAGE_COOKIE_NAME
  775. LANGUAGE_COOKIE_NAME
  776. --------------------
  777. Default: ``'django_language'``
  778. The name of the cookie to use for the language cookie. This can be whatever
  779. you want (but should be different from :setting:`SESSION_COOKIE_NAME`). See
  780. :doc:`/topics/i18n/index`.
  781. .. setting:: LANGUAGES
  782. LANGUAGES
  783. ---------
  784. Default: A tuple of all available languages. This list is continually growing
  785. and including a copy here would inevitably become rapidly out of date. You can
  786. see the current list of translated languages by looking in
  787. ``django/conf/global_settings.py`` (or view the `online source`_).
  788. .. _online source: http://code.djangoproject.com/browser/django/trunk/django/conf/global_settings.py
  789. The list is a tuple of two-tuples in the format ``(language code, language
  790. name)``, the ``language code`` part should be a
  791. :term:`language name<language code>` -- for example, ``('ja', 'Japanese')``.
  792. This specifies which languages are available for language selection. See
  793. :doc:`/topics/i18n/index`.
  794. Generally, the default value should suffice. Only set this setting if you want
  795. to restrict language selection to a subset of the Django-provided languages.
  796. If you define a custom :setting:`LANGUAGES` setting, it's OK to mark the
  797. languages as translation strings (as in the default value referred to above)
  798. -- but use a "dummy" ``gettext()`` function, not the one in
  799. ``django.utils.translation``. You should *never* import
  800. ``django.utils.translation`` from within your settings file, because that
  801. module in itself depends on the settings, and that would cause a circular
  802. import.
  803. The solution is to use a "dummy" ``gettext()`` function. Here's a sample
  804. settings file::
  805. gettext = lambda s: s
  806. LANGUAGES = (
  807. ('de', gettext('German')),
  808. ('en', gettext('English')),
  809. )
  810. With this arrangement, ``django-admin.py makemessages`` will still find and
  811. mark these strings for translation, but the translation won't happen at
  812. runtime -- so you'll have to remember to wrap the languages in the *real*
  813. ``gettext()`` in any code that uses :setting:`LANGUAGES` at runtime.
  814. .. setting:: LOCALE_PATHS
  815. LOCALE_PATHS
  816. ------------
  817. Default: ``()`` (Empty tuple)
  818. A tuple of directories where Django looks for translation files.
  819. See :ref:`how-django-discovers-translations`.
  820. Example::
  821. LOCALE_PATHS = (
  822. '/home/www/project/common_files/locale',
  823. '/var/local/translations/locale'
  824. )
  825. Note that in the paths you add to the value of this setting, if you have the
  826. typical ``/path/to/locale/xx/LC_MESSAGES`` hierarchy, you should use the path to
  827. the ``locale`` directory (i.e. ``'/path/to/locale'``).
  828. .. setting:: LOGGING
  829. LOGGING
  830. -------
  831. .. versionadded:: 1.3
  832. Default: A logging configuration dictionary.
  833. A data structure containing configuration information. The contents of
  834. this data structure will be passed as the argument to the
  835. configuration method described in :setting:`LOGGING_CONFIG`.
  836. The default logging configuration passes HTTP 500 server errors to an
  837. email log handler; all other log messages are given to a NullHandler.
  838. .. setting:: LOGGING_CONFIG
  839. LOGGING_CONFIG
  840. --------------
  841. .. versionadded:: 1.3
  842. Default: ``'django.utils.log.dictConfig'``
  843. A path to a callable that will be used to configure logging in the
  844. Django project. Points at a instance of Python's `dictConfig`_
  845. configuration method by default.
  846. If you set :setting:`LOGGING_CONFIG` to ``None``, the logging
  847. configuration process will be skipped.
  848. .. _dictConfig: http://docs.python.org/library/logging.config.html#configuration-dictionary-schema
  849. .. setting:: LOGIN_REDIRECT_URL
  850. LOGIN_REDIRECT_URL
  851. ------------------
  852. Default: ``'/accounts/profile/'``
  853. The URL where requests are redirected after login when the
  854. ``contrib.auth.login`` view gets no ``next`` parameter.
  855. This is used by the :func:`~django.contrib.auth.decorators.login_required`
  856. decorator, for example.
  857. .. setting:: LOGIN_URL
  858. LOGIN_URL
  859. ---------
  860. Default: ``'/accounts/login/'``
  861. The URL where requests are redirected for login, especially when using the
  862. :func:`~django.contrib.auth.decorators.login_required` decorator.
  863. .. setting:: LOGOUT_URL
  864. LOGOUT_URL
  865. ----------
  866. Default: ``'/accounts/logout/'``
  867. LOGIN_URL counterpart.
  868. .. setting:: MANAGERS
  869. MANAGERS
  870. --------
  871. Default: ``()`` (Empty tuple)
  872. A tuple in the same format as :setting:`ADMINS` that specifies who should get
  873. broken-link notifications when ``SEND_BROKEN_LINK_EMAILS=True``.
  874. .. setting:: MEDIA_ROOT
  875. MEDIA_ROOT
  876. ----------
  877. Default: ``''`` (Empty string)
  878. Absolute path to the directory that holds media for this installation, used
  879. for :doc:`managing stored files </topics/files>`.
  880. Example: ``"/home/media/media.lawrence.com/"``
  881. See also :setting:`MEDIA_URL`.
  882. .. setting:: MEDIA_URL
  883. MEDIA_URL
  884. ---------
  885. Default: ``''`` (Empty string)
  886. URL that handles the media served from :setting:`MEDIA_ROOT`, used
  887. for :doc:`managing stored files </topics/files>`.
  888. Example: ``"http://media.lawrence.com/"``
  889. .. versionchanged:: 1.3
  890. It must end in a slash if set to a non-empty value.
  891. MESSAGE_LEVEL
  892. -------------
  893. .. versionadded:: 1.2
  894. Default: `messages.INFO`
  895. Sets the minimum message level that will be recorded by the messages
  896. framework. See the :doc:`messages documentation </ref/contrib/messages>` for
  897. more details.
  898. MESSAGE_STORAGE
  899. ---------------
  900. .. versionadded:: 1.2
  901. Default: ``'django.contrib.messages.storage.user_messages.LegacyFallbackStorage'``
  902. Controls where Django stores message data. See the
  903. :doc:`messages documentation </ref/contrib/messages>` for more details.
  904. MESSAGE_TAGS
  905. ------------
  906. .. versionadded:: 1.2
  907. Default::
  908. {messages.DEBUG: 'debug',
  909. messages.INFO: 'info',
  910. messages.SUCCESS: 'success',
  911. messages.WARNING: 'warning',
  912. messages.ERROR: 'error',}
  913. Sets the mapping of message levels to message tags. See the
  914. :doc:`messages documentation </ref/contrib/messages>` for more details.
  915. .. setting:: MIDDLEWARE_CLASSES
  916. MIDDLEWARE_CLASSES
  917. ------------------
  918. Default::
  919. ('django.middleware.common.CommonMiddleware',
  920. 'django.contrib.sessions.middleware.SessionMiddleware',
  921. 'django.middleware.csrf.CsrfViewMiddleware',
  922. 'django.contrib.auth.middleware.AuthenticationMiddleware',
  923. 'django.contrib.messages.middleware.MessageMiddleware',)
  924. A tuple of middleware classes to use. See :doc:`/topics/http/middleware`.
  925. .. versionchanged:: 1.2
  926. ``'django.contrib.messages.middleware.MessageMiddleware'`` was added to the
  927. default. For more information, see the :doc:`messages documentation
  928. </ref/contrib/messages>`.
  929. .. setting:: MONTH_DAY_FORMAT
  930. MONTH_DAY_FORMAT
  931. ----------------
  932. Default: ``'F j'``
  933. The default formatting to use for date fields on Django admin change-list
  934. pages -- and, possibly, by other parts of the system -- in cases when only the
  935. month and day are displayed.
  936. For example, when a Django admin change-list page is being filtered by a date
  937. drilldown, the header for a given day displays the day and month. Different
  938. locales have different formats. For example, U.S. English would say
  939. "January 1," whereas Spanish might say "1 Enero."
  940. See :tfilter:`allowed date format strings <date>`. See also
  941. :setting:`DATE_FORMAT`, :setting:`DATETIME_FORMAT`,
  942. :setting:`TIME_FORMAT` and :setting:`YEAR_MONTH_FORMAT`.
  943. .. setting:: NUMBER_GROUPING
  944. NUMBER_GROUPING
  945. ----------------
  946. .. versionadded:: 1.2
  947. Default: ``0``
  948. Number of digits grouped together on the integer part of a number.
  949. Common use is to display a thousand separator. If this setting is ``0``, then
  950. no grouping will be applied to the number. If this setting is greater than
  951. ``0``, then :setting:`THOUSAND_SEPARATOR` will be used as the separator between
  952. those groups.
  953. Note that if :setting:`USE_L10N` is set to ``True``, then the locale-dictated
  954. format has higher precedence and will be applied instead.
  955. See also :setting:`DECIMAL_SEPARATOR`, :setting:`THOUSAND_SEPARATOR` and
  956. :setting:`USE_THOUSAND_SEPARATOR`.
  957. .. setting:: PASSWORD_RESET_TIMEOUT_DAYS
  958. PASSWORD_RESET_TIMEOUT_DAYS
  959. ---------------------------
  960. Default: ``3``
  961. The number of days a password reset link is valid for. Used by the
  962. :mod:`django.contrib.auth` password reset mechanism.
  963. .. setting:: PREPEND_WWW
  964. PREPEND_WWW
  965. -----------
  966. Default: ``False``
  967. Whether to prepend the "www." subdomain to URLs that don't have it. This is only
  968. used if :class:`~django.middleware.common.CommonMiddleware` is installed
  969. (see :doc:`/topics/http/middleware`). See also :setting:`APPEND_SLASH`.
  970. .. setting:: PROFANITIES_LIST
  971. PROFANITIES_LIST
  972. ----------------
  973. Default: ``()`` (Empty tuple)
  974. A tuple of profanities, as strings, that will be forbidden in comments when
  975. :setting:`COMMENTS_ALLOW_PROFANITIES` is ``False``.
  976. .. setting:: RESTRUCTUREDTEXT_FILTER_SETTINGS
  977. RESTRUCTUREDTEXT_FILTER_SETTINGS
  978. --------------------------------
  979. Default: ``{}``
  980. A dictionary containing settings for the ``restructuredtext`` markup filter from
  981. the :doc:`django.contrib.markup application </ref/contrib/markup>`. They override
  982. the default writer settings. See the Docutils restructuredtext `writer settings
  983. docs`_ for details.
  984. .. _writer settings docs: http://docutils.sourceforge.net/docs/user/config.html#html4css1-writer
  985. .. setting:: ROOT_URLCONF
  986. ROOT_URLCONF
  987. ------------
  988. Default: Not defined
  989. A string representing the full Python import path to your root URLconf. For example:
  990. ``"mydjangoapps.urls"``. Can be overridden on a per-request basis by
  991. setting the attribute ``urlconf`` on the incoming ``HttpRequest``
  992. object. See :ref:`how-django-processes-a-request` for details.
  993. .. setting:: SECRET_KEY
  994. SECRET_KEY
  995. ----------
  996. Default: ``''`` (Empty string)
  997. A secret key for this particular Django installation. Used to provide a seed in
  998. secret-key hashing algorithms. Set this to a random string -- the longer, the
  999. better. ``django-admin.py startproject`` creates one automatically.
  1000. .. setting:: SECURE_PROXY_SSL_HEADER
  1001. SECURE_PROXY_SSL_HEADER
  1002. -----------------------
  1003. .. versionadded:: 1.4
  1004. Default: ``None``
  1005. A tuple representing a HTTP header/value combination that signifies a request
  1006. is secure. This controls the behavior of the request object's ``is_secure()``
  1007. method.
  1008. This takes some explanation. By default, ``is_secure()`` is able to determine
  1009. whether a request is secure by looking at whether the requested URL uses
  1010. "https://".
  1011. If your Django app is behind a proxy, though, the proxy may be "swallowing" the
  1012. fact that a request is HTTPS, using a non-HTTPS connection between the proxy
  1013. and Django. In this case, ``is_secure()`` would always return ``False`` -- even
  1014. for requests that were made via HTTPS by the end user.
  1015. In this situation, you'll want to configure your proxy to set a custom HTTP
  1016. header that tells Django whether the request came in via HTTPS, and you'll want
  1017. to set ``SECURE_PROXY_SSL_HEADER`` so that Django knows what header to look
  1018. for.
  1019. You'll need to set a tuple with two elements -- the name of the header to look
  1020. for and the required value. For example::
  1021. SECURE_PROXY_SSL_HEADER = ('HTTP_X_FORWARDED_PROTOCOL', 'https')
  1022. Here, we're telling Django that we trust the ``X-Forwarded-Protocol`` header
  1023. that comes from our proxy, and any time its value is ``'https'``, then the
  1024. request is guaranteed to be secure (i.e., it originally came in via HTTPS).
  1025. Obviously, you should *only* set this setting if you control your proxy or
  1026. have some other guarantee that it sets/strips this header appropriately.
  1027. Note that the header needs to be in the format as used by ``request.META`` --
  1028. all caps and likely starting with ``HTTP_``. (Remember, Django automatically
  1029. adds ``'HTTP_'`` to the start of x-header names before making the header
  1030. available in ``request.META``.)
  1031. .. warning::
  1032. **You will probably open security holes in your site if you set this without knowing what you're doing. Seriously.**
  1033. Make sure ALL of the following are true before setting this (assuming the
  1034. values from the example above):
  1035. * Your Django app is behind a proxy.
  1036. * Your proxy strips the 'X-Forwarded-Protocol' header from all incoming
  1037. requests. In other words, if end users include that header in their
  1038. requests, the proxy will discard it.
  1039. * Your proxy sets the 'X-Forwarded-Protocol' header and sends it to Django,
  1040. but only for requests that originally come in via HTTPS.
  1041. If any of those are not true, you should keep this setting set to ``None``
  1042. and find another way of determining HTTPS, perhaps via custom middleware.
  1043. .. setting:: SEND_BROKEN_LINK_EMAILS
  1044. SEND_BROKEN_LINK_EMAILS
  1045. -----------------------
  1046. Default: ``False``
  1047. Whether to send an email to the :setting:`MANAGERS` each time somebody visits
  1048. a Django-powered page that is 404ed with a non-empty referer (i.e., a broken
  1049. link). This is only used if ``CommonMiddleware`` is installed (see
  1050. :doc:`/topics/http/middleware`). See also :setting:`IGNORABLE_404_URLS` and
  1051. :doc:`/howto/error-reporting`.
  1052. .. setting:: SERIALIZATION_MODULES
  1053. SERIALIZATION_MODULES
  1054. ---------------------
  1055. Default: Not defined.
  1056. A dictionary of modules containing serializer definitions (provided as
  1057. strings), keyed by a string identifier for that serialization type. For
  1058. example, to define a YAML serializer, use::
  1059. SERIALIZATION_MODULES = { 'yaml' : 'path.to.yaml_serializer' }
  1060. .. setting:: SERVER_EMAIL
  1061. SERVER_EMAIL
  1062. ------------
  1063. Default: ``'root@localhost'``
  1064. The email address that error messages come from, such as those sent to
  1065. :setting:`ADMINS` and :setting:`MANAGERS`.
  1066. .. setting:: SESSION_COOKIE_AGE
  1067. SESSION_COOKIE_AGE
  1068. ------------------
  1069. Default: ``1209600`` (2 weeks, in seconds)
  1070. The age of session cookies, in seconds. See :doc:`/topics/http/sessions`.
  1071. .. setting:: SESSION_COOKIE_DOMAIN
  1072. SESSION_COOKIE_DOMAIN
  1073. ---------------------
  1074. Default: ``None``
  1075. The domain to use for session cookies. Set this to a string such as
  1076. ``".lawrence.com"`` for cross-domain cookies, or use ``None`` for a standard
  1077. domain cookie. See the :doc:`/topics/http/sessions`.
  1078. .. setting:: SESSION_COOKIE_HTTPONLY
  1079. SESSION_COOKIE_HTTPONLY
  1080. -----------------------
  1081. Default: ``False``
  1082. Whether to use HTTPOnly flag on the session cookie. If this is set to
  1083. ``True``, client-side JavaScript will not to be able to access the
  1084. session cookie.
  1085. HTTPOnly_ is a flag included in a Set-Cookie HTTP response header. It
  1086. is not part of the :rfc:`2109` standard for cookies, and it isn't honored
  1087. consistently by all browsers. However, when it is honored, it can be a
  1088. useful way to mitigate the risk of client side script accessing the
  1089. protected cookie data.
  1090. .. _HTTPOnly: http://www.owasp.org/index.php/HTTPOnly
  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_COOKIE_SECURE
  1108. SESSION_COOKIE_SECURE
  1109. ---------------------
  1110. Default: ``False``
  1111. Whether to use a secure cookie for the session cookie. If this is set to
  1112. ``True``, the cookie will be marked as "secure," which means browsers may
  1113. ensure that the cookie is only sent under an HTTPS connection.
  1114. See the :doc:`/topics/http/sessions`.
  1115. .. setting:: SESSION_ENGINE
  1116. SESSION_ENGINE
  1117. --------------
  1118. Default: ``django.contrib.sessions.backends.db``
  1119. Controls where Django stores session data. Valid values are:
  1120. * ``'django.contrib.sessions.backends.db'``
  1121. * ``'django.contrib.sessions.backends.file'``
  1122. * ``'django.contrib.sessions.backends.cache'``
  1123. * ``'django.contrib.sessions.backends.cached_db'``
  1124. See :doc:`/topics/http/sessions`.
  1125. .. setting:: SESSION_EXPIRE_AT_BROWSER_CLOSE
  1126. SESSION_EXPIRE_AT_BROWSER_CLOSE
  1127. -------------------------------
  1128. Default: ``False``
  1129. Whether to expire the session when the user closes his or her browser.
  1130. See the :doc:`/topics/http/sessions`.
  1131. .. setting:: SESSION_FILE_PATH
  1132. SESSION_FILE_PATH
  1133. -----------------
  1134. Default: ``None``
  1135. If you're using file-based session storage, this sets the directory in
  1136. which Django will store session data. See :doc:`/topics/http/sessions`. When
  1137. the default value (``None``) is used, Django will use the standard temporary
  1138. directory for the system.
  1139. .. setting:: SESSION_SAVE_EVERY_REQUEST
  1140. SESSION_SAVE_EVERY_REQUEST
  1141. --------------------------
  1142. Default: ``False``
  1143. Whether to save the session data on every request. See
  1144. :doc:`/topics/http/sessions`.
  1145. .. setting:: SHORT_DATE_FORMAT
  1146. SHORT_DATE_FORMAT
  1147. -----------------
  1148. .. versionadded:: 1.2
  1149. Default: ``m/d/Y`` (e.g. ``12/31/2003``)
  1150. An available formatting that can be used for displaying date fields on
  1151. templates. Note that if :setting:`USE_L10N` is set to ``True``, then the
  1152. corresponding locale-dictated format has higher precedence and will be applied.
  1153. See :tfilter:`allowed date format strings <date>`.
  1154. See also :setting:`DATE_FORMAT` and :setting:`SHORT_DATETIME_FORMAT`.
  1155. .. setting:: SHORT_DATETIME_FORMAT
  1156. SHORT_DATETIME_FORMAT
  1157. ---------------------
  1158. .. versionadded:: 1.2
  1159. Default: ``m/d/Y P`` (e.g. ``12/31/2003 4 p.m.``)
  1160. An available formatting that can be used for displaying datetime fields on
  1161. templates. Note that if :setting:`USE_L10N` is set to ``True``, then the
  1162. corresponding locale-dictated format has higher precedence and will be applied.
  1163. See :tfilter:`allowed date format strings <date>`.
  1164. See also :setting:`DATE_FORMAT` and :setting:`SHORT_DATE_FORMAT`.
  1165. .. setting:: SIGNING_BACKEND
  1166. SIGNING_BACKEND
  1167. ---------------
  1168. .. versionadded:: 1.4
  1169. Default: 'django.core.signing.TimestampSigner'
  1170. The backend used for signing cookies and other data.
  1171. See also the :doc:`/topics/signing` documentation.
  1172. .. setting:: SITE_ID
  1173. SITE_ID
  1174. -------
  1175. Default: Not defined
  1176. The ID, as an integer, of the current site in the ``django_site`` database
  1177. table. This is used so that application data can hook into specific site(s)
  1178. and a single database can manage content for multiple sites.
  1179. See :doc:`/ref/contrib/sites`.
  1180. .. _site framework docs: ../sites/
  1181. .. setting:: STATIC_ROOT
  1182. STATIC_ROOT
  1183. -----------
  1184. Default: ``''`` (Empty string)
  1185. The absolute path to the directory where :djadmin:`collectstatic` will collect
  1186. static files for deployment.
  1187. Example: ``"/home/example.com/static/"``
  1188. If the :doc:`staticfiles</ref/contrib/staticfiles>` contrib app is enabled
  1189. (default) the :djadmin:`collectstatic` management command will collect static
  1190. files into this directory. See the howto on :doc:`managing static
  1191. files</howto/static-files>` for more details about usage.
  1192. .. warning::
  1193. This should be an (initially empty) destination directory for collecting
  1194. your static files from their permanent locations into one directory for
  1195. ease of deployment; it is **not** a place to store your static files
  1196. permanently. You should do that in directories that will be found by
  1197. :doc:`staticfiles</ref/contrib/staticfiles>`'s
  1198. :setting:`finders<STATICFILES_FINDERS>`, which by default, are
  1199. ``'static/'`` app sub-directories and any directories you include in
  1200. :setting:`STATICFILES_DIRS`).
  1201. See :doc:`staticfiles reference</ref/contrib/staticfiles>` and
  1202. :setting:`STATIC_URL`.
  1203. .. setting:: STATIC_URL
  1204. STATIC_URL
  1205. ----------
  1206. Default: ``None``
  1207. URL to use when referring to static files located in :setting:`STATIC_ROOT`.
  1208. Example: ``"/site_media/static/"`` or ``"http://static.example.com/"``
  1209. If not ``None``, this will be used as the base path for
  1210. :ref:`media definitions<form-media-paths>` and the
  1211. :doc:`staticfiles app</ref/contrib/staticfiles>`.
  1212. It must end in a slash if set to a non-empty value.
  1213. See :setting:`STATIC_ROOT`.
  1214. .. setting:: TEMPLATE_CONTEXT_PROCESSORS
  1215. TEMPLATE_CONTEXT_PROCESSORS
  1216. ---------------------------
  1217. Default::
  1218. ("django.contrib.auth.context_processors.auth",
  1219. "django.core.context_processors.debug",
  1220. "django.core.context_processors.i18n",
  1221. "django.core.context_processors.media",
  1222. "django.core.context_processors.static",
  1223. "django.core.context_processors.tz",
  1224. "django.contrib.messages.context_processors.messages")
  1225. A tuple of callables that are used to populate the context in ``RequestContext``.
  1226. These callables take a request object as their argument and return a dictionary
  1227. of items to be merged into the context.
  1228. .. versionchanged:: 1.2
  1229. ``django.contrib.messages.context_processors.messages`` was added to the
  1230. default. For more information, see the :doc:`messages documentation
  1231. </ref/contrib/messages>`.
  1232. .. versionchanged:: 1.2
  1233. The auth context processor was moved in this release from its old location
  1234. ``django.core.context_processors.auth`` to
  1235. ``django.contrib.auth.context_processors.auth``.
  1236. .. versionadded:: 1.3
  1237. The ``django.core.context_processors.static`` context processor
  1238. was added in this release.
  1239. .. versionadded:: 1.4
  1240. The ``django.core.context_processors.tz`` context processor
  1241. was added in this release.
  1242. .. setting:: TEMPLATE_DEBUG
  1243. TEMPLATE_DEBUG
  1244. --------------
  1245. Default: ``False``
  1246. A boolean that turns on/off template debug mode. If this is ``True``, the fancy
  1247. error page will display a detailed report for any exception raised during
  1248. template rendering. This report contains the relevant snippet of the template,
  1249. with the appropriate line highlighted.
  1250. Note that Django only displays fancy error pages if :setting:`DEBUG` is ``True``, so
  1251. you'll want to set that to take advantage of this setting.
  1252. See also :setting:`DEBUG`.
  1253. .. setting:: TEMPLATE_DIRS
  1254. TEMPLATE_DIRS
  1255. -------------
  1256. Default: ``()`` (Empty tuple)
  1257. List of locations of the template source files searched by
  1258. :class:`django.template.loaders.filesystem.Loader`, in search order.
  1259. Note that these paths should use Unix-style forward slashes, even on Windows.
  1260. See :doc:`/topics/templates`.
  1261. .. setting:: TEMPLATE_LOADERS
  1262. TEMPLATE_LOADERS
  1263. ----------------
  1264. Default::
  1265. ('django.template.loaders.filesystem.Loader',
  1266. 'django.template.loaders.app_directories.Loader')
  1267. A tuple of template loader classes, specified as strings. Each ``Loader`` class
  1268. knows how to import templates from a particular source. Optionally, a tuple can be
  1269. used instead of a string. The first item in the tuple should be the ``Loader``'s
  1270. module, subsequent items are passed to the ``Loader`` during initialization. See
  1271. :doc:`/ref/templates/api`.
  1272. .. versionchanged:: 1.2
  1273. The class-based API for template loaders was introduced in Django 1.2
  1274. although the :setting:`TEMPLATE_LOADERS` setting will accept strings
  1275. that specify function-based loaders until compatibility with them is
  1276. completely removed in Django 1.4.
  1277. .. setting:: TEMPLATE_STRING_IF_INVALID
  1278. TEMPLATE_STRING_IF_INVALID
  1279. --------------------------
  1280. Default: ``''`` (Empty string)
  1281. Output, as a string, that the template system should use for invalid (e.g.
  1282. misspelled) variables. See :ref:`invalid-template-variables`..
  1283. .. setting:: TEST_RUNNER
  1284. TEST_RUNNER
  1285. -----------
  1286. Default: ``'django.test.simple.DjangoTestSuiteRunner'``
  1287. .. versionchanged:: 1.2
  1288. Prior to 1.2, test runners were a function, not a class.
  1289. The name of the class to use for starting the test suite. See
  1290. :doc:`/topics/testing`.
  1291. .. _Testing Django Applications: ../testing/
  1292. .. setting:: THOUSAND_SEPARATOR
  1293. THOUSAND_SEPARATOR
  1294. ------------------
  1295. .. versionadded:: 1.2
  1296. Default: ``,`` (Comma)
  1297. Default thousand separator used when formatting numbers. This setting is
  1298. used only when :setting:`USE_THOUSAND_SEPARATOR` is ``True`` and
  1299. :setting:`NUMBER_GROUPING` is greater than ``0``.
  1300. Note that if :setting:`USE_L10N` is set to ``True``, then the locale-dictated
  1301. format has higher precedence and will be applied instead.
  1302. See also :setting:`NUMBER_GROUPING`, :setting:`DECIMAL_SEPARATOR` and
  1303. :setting:`USE_THOUSAND_SEPARATOR`.
  1304. .. setting:: TIME_FORMAT
  1305. TIME_FORMAT
  1306. -----------
  1307. Default: ``'P'`` (e.g. ``4 p.m.``)
  1308. The default formatting to use for displaying time fields in any part of the
  1309. system. Note that if :setting:`USE_L10N` is set to ``True``, then the
  1310. locale-dictated format has higher precedence and will be applied instead. See
  1311. :tfilter:`allowed date format strings <date>`.
  1312. .. versionchanged:: 1.2
  1313. This setting can now be overriden by setting :setting:`USE_L10N` to ``True``.
  1314. See also :setting:`DATE_FORMAT` and :setting:`DATETIME_FORMAT`.
  1315. .. setting:: TIME_INPUT_FORMATS
  1316. TIME_INPUT_FORMATS
  1317. ------------------
  1318. .. versionadded:: 1.2
  1319. Default: ``('%H:%M:%S', '%H:%M')``
  1320. A tuple of formats that will be accepted when inputting data on a time field.
  1321. Formats will be tried in order, using the first valid. Note that these format
  1322. strings are specified in Python's datetime_ module syntax, that is different
  1323. from the one used by Django for formatting dates to be displayed.
  1324. When :setting:`USE_L10N` is ``True``, the locale-dictated format has higher
  1325. precedence and will be applied instead.
  1326. See also :setting:`DATE_INPUT_FORMATS` and :setting:`DATETIME_INPUT_FORMATS`.
  1327. .. _datetime: http://docs.python.org/library/datetime.html#strftime-strptime-behavior
  1328. .. setting:: TIME_ZONE
  1329. TIME_ZONE
  1330. ---------
  1331. Default: ``'America/Chicago'``
  1332. .. versionchanged:: 1.2
  1333. ``None`` was added as an allowed value.
  1334. .. versionchanged:: 1.4
  1335. The meaning of this setting now depends on the value of :setting:`USE_TZ`.
  1336. A string representing the time zone for this installation, or
  1337. ``None``. `See available choices`_. (Note that list of available
  1338. choices lists more than one on the same line; you'll want to use just
  1339. one of the choices for a given time zone. For instance, one line says
  1340. ``'Europe/London GB GB-Eire'``, but you should use the first bit of
  1341. that -- ``'Europe/London'`` -- as your :setting:`TIME_ZONE` setting.)
  1342. Note that this isn't necessarily the timezone of the server. For example, one
  1343. server may serve multiple Django-powered sites, each with a separate time zone
  1344. setting.
  1345. When :setting:`USE_TZ` is ``False``, this is the time zone in which Django will
  1346. store all datetimes. When :setting:`USE_TZ` is ``True``, this is the default
  1347. time zone that Django will use to display datetimes in templates and to
  1348. interpret datetimes entered in forms.
  1349. Django sets the ``os.environ['TZ']`` variable to the time zone you specify in
  1350. the :setting:`TIME_ZONE` setting. Thus, all your views and models will
  1351. automatically operate in this time zone. However, Django won't set the ``TZ``
  1352. environment variable under the following conditions:
  1353. * If you're using the manual configuration option as described in
  1354. :ref:`manually configuring settings
  1355. <settings-without-django-settings-module>`, or
  1356. * If you specify ``TIME_ZONE = None``. This will cause Django to fall
  1357. back to using the system timezone.
  1358. If Django doesn't set the ``TZ`` environment variable, it's up to you
  1359. to ensure your processes are running in the correct environment.
  1360. .. note::
  1361. Django cannot reliably use alternate time zones in a Windows
  1362. environment. If you're running Django on Windows, this variable
  1363. must be set to match the system timezone.
  1364. .. _See available choices: http://www.postgresql.org/docs/8.1/static/datetime-keywords.html#DATETIME-TIMEZONE-SET-TABLE
  1365. .. setting:: URL_VALIDATOR_USER_AGENT
  1366. URL_VALIDATOR_USER_AGENT
  1367. ------------------------
  1368. Default: ``Django/<version> (http://www.djangoproject.com/)``
  1369. The string to use as the ``User-Agent`` header when checking to see if
  1370. URLs exist (see the ``verify_exists`` option on
  1371. :class:`~django.db.models.URLField`). This setting was deprecated in
  1372. 1.3.1 along with ``verify_exists`` and will be removed in 1.4.
  1373. .. setting:: USE_ETAGS
  1374. USE_ETAGS
  1375. ---------
  1376. Default: ``False``
  1377. A boolean that specifies whether to output the "Etag" header. This saves
  1378. bandwidth but slows down performance. This is used by the ``CommonMiddleware``
  1379. (see :doc:`/topics/http/middleware`) and in the``Cache Framework``
  1380. (see :doc:`/topics/cache`).
  1381. .. setting:: USE_I18N
  1382. USE_I18N
  1383. --------
  1384. Default: ``True``
  1385. A boolean that specifies whether Django's translation system should be enabled.
  1386. This provides an easy way to turn it off, for performance. If this is set to
  1387. ``False``, Django will make some optimizations so as not to load the
  1388. translation machinery.
  1389. See also :setting:`LANGUAGE_CODE`, :setting:`USE_L10N` and :setting:`USE_TZ`.
  1390. .. setting:: USE_L10N
  1391. USE_L10N
  1392. --------
  1393. .. versionadded:: 1.2
  1394. Default: ``False``
  1395. A boolean that specifies if localized formatting of data will be enabled by
  1396. default or not. If this is set to ``True``, e.g. Django will display numbers and
  1397. dates using the format of the current locale.
  1398. See also :setting:`LANGUAGE_CODE`, :setting:`USE_I18N` and :setting:`USE_TZ`.
  1399. .. note::
  1400. The default :file:`settings.py` file created by :djadmin:`django-admin.py
  1401. startproject <startproject>` includes ``USE_L10N = True`` for convenience.
  1402. .. setting:: USE_THOUSAND_SEPARATOR
  1403. USE_THOUSAND_SEPARATOR
  1404. ----------------------
  1405. .. versionadded:: 1.2
  1406. Default: ``False``
  1407. A boolean that specifies whether to display numbers using a thousand separator.
  1408. When :setting:`USE_L10N` is set to ``True`` and if this is also set to
  1409. ``True``, Django will use the values of :setting:`THOUSAND_SEPARATOR` and
  1410. :setting:`NUMBER_GROUPING` to format numbers.
  1411. See also :setting:`DECIMAL_SEPARATOR`, :setting:`NUMBER_GROUPING` and
  1412. :setting:`THOUSAND_SEPARATOR`.
  1413. .. setting:: USE_TZ
  1414. USE_TZ
  1415. ------
  1416. .. versionadded:: 1.4
  1417. Default: ``False``
  1418. A boolean that specifies if datetimes will be timezone-aware by default or not.
  1419. If this is set to ``True``, Django will use timezone-aware datetimes internally.
  1420. Otherwise, Django will use naive datetimes in local time.
  1421. See also :setting:`TIME_ZONE`, :setting:`USE_I18N` and :setting:`USE_L10N`.
  1422. .. note::
  1423. The default :file:`settings.py` file created by
  1424. :djadmin:`django-admin.py startproject <startproject>` includes
  1425. ``USE_TZ = True`` for convenience.
  1426. .. setting:: USE_X_FORWARDED_HOST
  1427. USE_X_FORWARDED_HOST
  1428. --------------------
  1429. .. versionadded:: 1.3.1
  1430. Default: ``False``
  1431. A boolean that specifies whether to use the X-Forwarded-Host header in
  1432. preference to the Host header. This should only be enabled if a proxy
  1433. which sets this header is in use.
  1434. .. setting:: WSGI_APPLICATION
  1435. WSGI_APPLICATION
  1436. ----------------
  1437. .. versionadded:: 1.4
  1438. Default: ``None``
  1439. The full Python path of the WSGI application object that Django's built-in
  1440. servers (e.g. :djadmin:`runserver`) will use. The :djadmin:`django-admin.py
  1441. startproject <startproject>` management command will create a simple
  1442. ``wsgi.py`` file with an ``application`` callable in it, and point this setting
  1443. to that ``application``.
  1444. If not set, the return value of :func:`django.core.wsgi.get_wsgi_application`
  1445. will be used. In this case, the behavior of :djadmin:`runserver` will be
  1446. identical to previous Django versions.
  1447. .. setting:: YEAR_MONTH_FORMAT
  1448. YEAR_MONTH_FORMAT
  1449. -----------------
  1450. Default: ``'F Y'``
  1451. The default formatting to use for date fields on Django admin change-list
  1452. pages -- and, possibly, by other parts of the system -- in cases when only the
  1453. year and month are displayed.
  1454. For example, when a Django admin change-list page is being filtered by a date
  1455. drilldown, the header for a given month displays the month and the year.
  1456. Different locales have different formats. For example, U.S. English would say
  1457. "January 2006," whereas another locale might say "2006/January."
  1458. See :tfilter:`allowed date format strings <date>`. See also
  1459. :setting:`DATE_FORMAT`, :setting:`DATETIME_FORMAT`, :setting:`TIME_FORMAT`
  1460. and :setting:`MONTH_DAY_FORMAT`.
  1461. .. setting:: X_FRAME_OPTIONS
  1462. X_FRAME_OPTIONS
  1463. ---------------
  1464. Default: ``'SAMEORIGIN'``
  1465. The default value for the X-Frame-Options header used by
  1466. :class:`~django.middleware.clickjacking.XFrameOptionsMiddleware`. See the
  1467. :doc:`clickjacking protection </ref/clickjacking/>` documentation.
  1468. Deprecated settings
  1469. ===================
  1470. .. setting:: ADMIN_MEDIA_PREFIX
  1471. ADMIN_MEDIA_PREFIX
  1472. ------------------
  1473. .. deprecated:: 1.4
  1474. This setting has been obsoleted by the ``django.contrib.staticfiles`` app
  1475. integration. See the :doc:`Django 1.4 release notes</releases/1.4>` for
  1476. more information.
  1477. .. setting:: CACHE_BACKEND
  1478. CACHE_BACKEND
  1479. -------------
  1480. .. deprecated:: 1.3
  1481. This setting has been replaced by :setting:`BACKEND <CACHES-BACKEND>` in
  1482. :setting:`CACHES`.
  1483. .. setting:: IGNORABLE_404_ENDS
  1484. IGNORABLE_404_ENDS
  1485. ------------------
  1486. .. deprecated:: 1.4
  1487. This setting has been superseded by :setting:`IGNORABLE_404_URLS`.
  1488. .. setting:: IGNORABLE_404_STARTS
  1489. IGNORABLE_404_STARTS
  1490. --------------------
  1491. .. deprecated:: 1.4
  1492. This setting has been superseded by :setting:`IGNORABLE_404_URLS`.