settings.txt 56 KB

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