settings.txt 43 KB

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