PageRenderTime 60ms CodeModel.GetById 18ms RepoModel.GetById 0ms app.codeStats 1ms

/docs/ref/settings.txt

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