settings.txt 63 KB

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