settings.txt 56 KB

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