settings.txt 49 KB

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