settings.txt 78 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760
  1. ========
  2. Settings
  3. ========
  4. .. contents::
  5. :local:
  6. :depth: 1
  7. .. warning::
  8. Be careful when you override settings, especially when the default value
  9. is a non-empty tuple or dictionary, such as :setting:`MIDDLEWARE_CLASSES`
  10. and :setting:`TEMPLATE_CONTEXT_PROCESSORS`. Make sure you keep the
  11. components required by the features of Django you wish to use.
  12. Core settings
  13. =============
  14. Here's a list of settings available in Django core and their default values.
  15. Settings provided by contrib apps are listed below, followed by a topical index
  16. of the core settings.
  17. .. setting:: ABSOLUTE_URL_OVERRIDES
  18. ABSOLUTE_URL_OVERRIDES
  19. ----------------------
  20. Default: ``{}`` (Empty dictionary)
  21. A dictionary mapping ``"app_label.model_name"`` strings to functions that take
  22. a model object and return its URL. This is a way of overriding
  23. ``get_absolute_url()`` methods on a per-installation basis. Example::
  24. ABSOLUTE_URL_OVERRIDES = {
  25. 'blogs.weblog': lambda o: "/blogs/%s/" % o.slug,
  26. 'news.story': lambda o: "/stories/%s/%s/" % (o.pub_year, o.slug),
  27. }
  28. Note that the model name used in this setting should be all lower-case, regardless
  29. of the case of the actual model class name.
  30. .. setting:: ADMINS
  31. ADMINS
  32. ------
  33. Default: ``()`` (Empty tuple)
  34. A tuple that lists people who get code error notifications. When
  35. ``DEBUG=False`` and a view raises an exception, Django will email these people
  36. with the full exception information. Each member of the tuple should be a tuple
  37. of (Full name, email address). Example::
  38. (('John', 'john@example.com'), ('Mary', 'mary@example.com'))
  39. Note that Django will email *all* of these people whenever an error happens.
  40. See :doc:`/howto/error-reporting` for more information.
  41. .. setting:: ALLOWED_HOSTS
  42. ALLOWED_HOSTS
  43. -------------
  44. Default: ``[]`` (Empty list)
  45. A list of strings representing the host/domain names that this Django site can
  46. serve. This is a security measure to prevent an attacker from poisoning caches
  47. and password reset emails with links to malicious hosts by submitting requests
  48. with a fake HTTP ``Host`` header, which is possible even under many
  49. seemingly-safe web server configurations.
  50. Values in this list can be fully qualified names (e.g. ``'www.example.com'``),
  51. in which case they will be matched against the request's ``Host`` header
  52. exactly (case-insensitive, not including port). A value beginning with a period
  53. can be used as a subdomain wildcard: ``'.example.com'`` will match
  54. ``example.com``, ``www.example.com``, and any other subdomain of
  55. ``example.com``. A value of ``'*'`` will match anything; in this case you are
  56. responsible to provide your own validation of the ``Host`` header (perhaps in a
  57. middleware; if so this middleware must be listed first in
  58. :setting:`MIDDLEWARE_CLASSES`).
  59. .. note::
  60. If you want to also allow the `fully qualified domain name (FQDN)`_, which
  61. some browsers can send in the Host header, you must explicitly add another
  62. ALLOWED_HOSTS entry that includes a trailing period. This entry can also be
  63. a subdomain wildcard::
  64. ALLOWED_HOSTS = [
  65. '.example.com', # Allow domain and subdomains
  66. '.example.com.', # Also allow FQDN and subdomains
  67. ]
  68. .. _`fully qualified domain name (FQDN)`: http://en.wikipedia.org/wiki/Fully_qualified_domain_name
  69. If the ``Host`` header (or ``X-Forwarded-Host`` if
  70. :setting:`USE_X_FORWARDED_HOST` is enabled) does not match any value in this
  71. list, the :meth:`django.http.HttpRequest.get_host()` method will raise
  72. :exc:`~django.core.exceptions.SuspiciousOperation`.
  73. When :setting:`DEBUG` is ``True`` or when running tests, host validation is
  74. disabled; any host will be accepted. Thus it's usually only necessary to set it
  75. in production.
  76. This validation only applies via :meth:`~django.http.HttpRequest.get_host()`;
  77. if your code accesses the ``Host`` header directly from ``request.META`` you
  78. are bypassing this security protection.
  79. .. setting:: ALLOWED_INCLUDE_ROOTS
  80. ALLOWED_INCLUDE_ROOTS
  81. ---------------------
  82. Default: ``()`` (Empty tuple)
  83. A tuple of strings representing allowed prefixes for the ``{% ssi %}`` template
  84. tag. This is a security measure, so that template authors can't access files
  85. that they shouldn't be accessing.
  86. For example, if :setting:`ALLOWED_INCLUDE_ROOTS` is ``('/home/html', '/var/www')``,
  87. then ``{% ssi /home/html/foo.txt %}`` would work, but ``{% ssi /etc/passwd %}``
  88. wouldn't.
  89. .. setting:: APPEND_SLASH
  90. APPEND_SLASH
  91. ------------
  92. Default: ``True``
  93. When set to ``True``, if the request URL does not match any of the patterns
  94. in the URLconf and it doesn't end in a slash, an HTTP redirect is issued to the
  95. same URL with a slash appended. Note that the redirect may cause any data
  96. submitted in a POST request to be lost.
  97. The :setting:`APPEND_SLASH` setting is only used if
  98. :class:`~django.middleware.common.CommonMiddleware` is installed
  99. (see :doc:`/topics/http/middleware`). See also :setting:`PREPEND_WWW`.
  100. .. setting:: CACHES
  101. CACHES
  102. ------
  103. Default::
  104. {
  105. 'default': {
  106. 'BACKEND': 'django.core.cache.backends.locmem.LocMemCache',
  107. }
  108. }
  109. A dictionary containing the settings for all caches to be used with
  110. Django. It is a nested dictionary whose contents maps cache aliases
  111. to a dictionary containing the options for an individual cache.
  112. The :setting:`CACHES` setting must configure a ``default`` cache;
  113. any number of additional caches may also be specified. If you
  114. are using a cache backend other than the local memory cache, or
  115. you need to define multiple caches, other options will be required.
  116. The following cache options are available.
  117. .. setting:: CACHES-BACKEND
  118. BACKEND
  119. ~~~~~~~
  120. Default: ``''`` (Empty string)
  121. The cache backend to use. The built-in cache backends are:
  122. * ``'django.core.cache.backends.db.DatabaseCache'``
  123. * ``'django.core.cache.backends.dummy.DummyCache'``
  124. * ``'django.core.cache.backends.filebased.FileBasedCache'``
  125. * ``'django.core.cache.backends.locmem.LocMemCache'``
  126. * ``'django.core.cache.backends.memcached.MemcachedCache'``
  127. * ``'django.core.cache.backends.memcached.PyLibMCCache'``
  128. You can use a cache backend that doesn't ship with Django by setting
  129. :setting:`BACKEND <CACHES-BACKEND>` to a fully-qualified path of a cache
  130. backend class (i.e. ``mypackage.backends.whatever.WhateverCache``).
  131. Writing a whole new cache backend from scratch is left as an exercise
  132. to the reader; see the other backends for examples.
  133. .. setting:: CACHES-KEY_FUNCTION
  134. KEY_FUNCTION
  135. ~~~~~~~~~~~~
  136. A string containing a dotted path to a function that defines how to
  137. compose a prefix, version and key into a final cache key. The default
  138. implementation is equivalent to the function::
  139. def make_key(key, key_prefix, version):
  140. return ':'.join([key_prefix, str(version), key])
  141. You may use any key function you want, as long as it has the same
  142. argument signature.
  143. See the :ref:`cache documentation <cache_key_transformation>` for more
  144. information.
  145. .. setting:: CACHES-KEY_PREFIX
  146. KEY_PREFIX
  147. ~~~~~~~~~~
  148. Default: ``''`` (Empty string)
  149. A string that will be automatically included (prepended by default) to
  150. all cache keys used by the Django server.
  151. See the :ref:`cache documentation <cache_key_prefixing>` for more information.
  152. .. setting:: CACHES-LOCATION
  153. LOCATION
  154. ~~~~~~~~
  155. Default: ``''`` (Empty string)
  156. The location of the cache to use. This might be the directory for a
  157. file system cache, a host and port for a memcache server, or simply an
  158. identifying name for a local memory cache. e.g.::
  159. CACHES = {
  160. 'default': {
  161. 'BACKEND': 'django.core.cache.backends.filebased.FileBasedCache',
  162. 'LOCATION': '/var/tmp/django_cache',
  163. }
  164. }
  165. .. setting:: CACHES-OPTIONS
  166. OPTIONS
  167. ~~~~~~~
  168. Default: None
  169. Extra parameters to pass to the cache backend. Available parameters
  170. vary depending on your cache backend.
  171. Some information on available parameters can be found in the
  172. :doc:`Cache Backends </topics/cache>` documentation. For more information,
  173. consult your backend module's own documentation.
  174. .. setting:: CACHES-TIMEOUT
  175. TIMEOUT
  176. ~~~~~~~
  177. Default: 300
  178. The number of seconds before a cache entry is considered stale.
  179. .. setting:: CACHES-VERSION
  180. VERSION
  181. ~~~~~~~
  182. Default: ``1``
  183. The default version number for cache keys generated by the Django server.
  184. See the :ref:`cache documentation <cache_versioning>` for more information.
  185. .. setting:: CACHE_MIDDLEWARE_ALIAS
  186. CACHE_MIDDLEWARE_ALIAS
  187. ----------------------
  188. Default: ``default``
  189. The cache connection to use for the cache middleware.
  190. .. setting:: CACHE_MIDDLEWARE_ANONYMOUS_ONLY
  191. CACHE_MIDDLEWARE_ANONYMOUS_ONLY
  192. -------------------------------
  193. Default: ``False``
  194. .. deprecated:: 1.6
  195. This setting was largely ineffective because of using cookies for sessions
  196. and CSRF. See the :doc:`Django 1.6 release notes</releases/1.6>` for more
  197. information.
  198. If the value of this setting is ``True``, only anonymous requests (i.e., not
  199. those made by a logged-in user) will be cached. Otherwise, the middleware
  200. caches every page that doesn't have GET or POST parameters.
  201. If you set the value of this setting to ``True``, you should make sure you've
  202. activated ``AuthenticationMiddleware``.
  203. .. setting:: CACHE_MIDDLEWARE_KEY_PREFIX
  204. CACHE_MIDDLEWARE_KEY_PREFIX
  205. ---------------------------
  206. Default: ``''`` (Empty string)
  207. The cache key prefix that the cache middleware should use.
  208. See :doc:`/topics/cache`.
  209. .. setting:: CACHE_MIDDLEWARE_SECONDS
  210. CACHE_MIDDLEWARE_SECONDS
  211. ------------------------
  212. Default: ``600``
  213. The default number of seconds to cache a page when the caching middleware or
  214. ``cache_page()`` decorator is used.
  215. See :doc:`/topics/cache`.
  216. .. _settings-csrf:
  217. .. setting:: CSRF_COOKIE_DOMAIN
  218. CSRF_COOKIE_DOMAIN
  219. ------------------
  220. Default: ``None``
  221. The domain to be used when setting the CSRF cookie. This can be useful for
  222. easily allowing cross-subdomain requests to be excluded from the normal cross
  223. site request forgery protection. It should be set to a string such as
  224. ``".example.com"`` to allow a POST request from a form on one subdomain to be
  225. accepted by a view served from another subdomain.
  226. Please note that the presence of this setting does not imply that Django's CSRF
  227. protection is safe from cross-subdomain attacks by default - please see the
  228. :ref:`CSRF limitations <csrf-limitations>` section.
  229. .. setting:: CSRF_COOKIE_HTTPONLY
  230. CSRF_COOKIE_HTTPONLY
  231. --------------------
  232. .. versionadded:: 1.6
  233. Default: ``False``
  234. Whether to use ``HttpOnly`` flag on the CSRF cookie. If this is set to
  235. ``True``, client-side JavaScript will not to be able to access the CSRF cookie.
  236. See :setting:`SESSION_COOKIE_HTTPONLY` for details on ``HttpOnly``.
  237. .. setting:: CSRF_COOKIE_NAME
  238. CSRF_COOKIE_NAME
  239. ----------------
  240. Default: ``'csrftoken'``
  241. The name of the cookie to use for the CSRF authentication token. This can be whatever you
  242. want. See :doc:`/ref/contrib/csrf`.
  243. .. setting:: CSRF_COOKIE_PATH
  244. CSRF_COOKIE_PATH
  245. ----------------
  246. Default: ``'/'``
  247. The path set on the CSRF cookie. This should either match the URL path of your
  248. Django installation or be a parent of that path.
  249. This is useful if you have multiple Django instances running under the same
  250. hostname. They can use different cookie paths, and each instance will only see
  251. its own CSRF cookie.
  252. .. setting:: CSRF_COOKIE_SECURE
  253. CSRF_COOKIE_SECURE
  254. ------------------
  255. Default: ``False``
  256. Whether to use a secure cookie for the CSRF cookie. If this is set to ``True``,
  257. the cookie will be marked as "secure," which means browsers may ensure that the
  258. cookie is only sent under an HTTPS connection.
  259. .. setting:: CSRF_FAILURE_VIEW
  260. CSRF_FAILURE_VIEW
  261. -----------------
  262. Default: ``'django.views.csrf.csrf_failure'``
  263. A dotted path to the view function to be used when an incoming request
  264. is rejected by the CSRF protection. The function should have this signature::
  265. def csrf_failure(request, reason="")
  266. where ``reason`` is a short message (intended for developers or logging, not for
  267. end users) indicating the reason the request was rejected. See
  268. :doc:`/ref/contrib/csrf`.
  269. .. setting:: DATABASES
  270. DATABASES
  271. ---------
  272. Default: ``{}`` (Empty dictionary)
  273. A dictionary containing the settings for all databases to be used with
  274. Django. It is a nested dictionary whose contents maps database aliases
  275. to a dictionary containing the options for an individual database.
  276. The :setting:`DATABASES` setting must configure a ``default`` database;
  277. any number of additional databases may also be specified.
  278. The simplest possible settings file is for a single-database setup using
  279. SQLite. This can be configured using the following::
  280. DATABASES = {
  281. 'default': {
  282. 'ENGINE': 'django.db.backends.sqlite3',
  283. 'NAME': 'mydatabase'
  284. }
  285. }
  286. For other database backends, or more complex SQLite configurations, other options
  287. will be required. The following inner options are available.
  288. .. setting:: DATABASE-ATOMIC_REQUESTS
  289. ATOMIC_REQUESTS
  290. ~~~~~~~~~~~~~~~
  291. .. versionadded:: 1.6
  292. Default: ``False``
  293. Set this to ``True`` to wrap each HTTP request in a transaction on this
  294. database. See :ref:`tying-transactions-to-http-requests`.
  295. .. setting:: DATABASE-AUTOCOMMIT
  296. AUTOCOMMIT
  297. ~~~~~~~~~~
  298. .. versionadded:: 1.6
  299. Default: ``True``
  300. Set this to ``False`` if you want to :ref:`disable Django's transaction
  301. management <deactivate-transaction-management>` and implement your own.
  302. .. setting:: DATABASE-ENGINE
  303. ENGINE
  304. ~~~~~~
  305. Default: ``''`` (Empty string)
  306. The database backend to use. The built-in database backends are:
  307. * ``'django.db.backends.postgresql_psycopg2'``
  308. * ``'django.db.backends.mysql'``
  309. * ``'django.db.backends.sqlite3'``
  310. * ``'django.db.backends.oracle'``
  311. You can use a database backend that doesn't ship with Django by setting
  312. ``ENGINE`` to a fully-qualified path (i.e.
  313. ``mypackage.backends.whatever``). Writing a whole new database backend from
  314. scratch is left as an exercise to the reader; see the other backends for
  315. examples.
  316. .. setting:: HOST
  317. HOST
  318. ~~~~
  319. Default: ``''`` (Empty string)
  320. Which host to use when connecting to the database. An empty string means
  321. localhost. Not used with SQLite.
  322. If this value starts with a forward slash (``'/'``) and you're using MySQL,
  323. MySQL will connect via a Unix socket to the specified socket. For example::
  324. "HOST": '/var/run/mysql'
  325. If you're using MySQL and this value *doesn't* start with a forward slash, then
  326. this value is assumed to be the host.
  327. If you're using PostgreSQL, by default (empty :setting:`HOST`), the connection
  328. to the database is done through UNIX domain sockets ('local' lines in
  329. ``pg_hba.conf``). If you want to connect through TCP sockets, set
  330. :setting:`HOST` to 'localhost' or '127.0.0.1' ('host' lines in ``pg_hba.conf``).
  331. On Windows, you should always define :setting:`HOST`, as UNIX domain sockets
  332. are not available.
  333. .. setting:: NAME
  334. NAME
  335. ~~~~
  336. Default: ``''`` (Empty string)
  337. The name of the database to use. For SQLite, it's the full path to the database
  338. file. When specifying the path, always use forward slashes, even on Windows
  339. (e.g. ``C:/homes/user/mysite/sqlite3.db``).
  340. .. setting:: CONN_MAX_AGE
  341. CONN_MAX_AGE
  342. ~~~~~~~~~~~~
  343. .. versionadded:: 1.6
  344. Default: ``0``
  345. The lifetime of a database connection, in seconds. Use ``0`` to close database
  346. connections at the end of each request — Django's historical behavior — and
  347. ``None`` for unlimited persistent connections.
  348. .. setting:: OPTIONS
  349. OPTIONS
  350. ~~~~~~~
  351. Default: ``{}`` (Empty dictionary)
  352. Extra parameters to use when connecting to the database. Available parameters
  353. vary depending on your database backend.
  354. Some information on available parameters can be found in the
  355. :doc:`Database Backends </ref/databases>` documentation. For more information,
  356. consult your backend module's own documentation.
  357. .. setting:: PASSWORD
  358. PASSWORD
  359. ~~~~~~~~
  360. Default: ``''`` (Empty string)
  361. The password to use when connecting to the database. Not used with SQLite.
  362. .. setting:: PORT
  363. PORT
  364. ~~~~
  365. Default: ``''`` (Empty string)
  366. The port to use when connecting to the database. An empty string means the
  367. default port. Not used with SQLite.
  368. .. setting:: USER
  369. USER
  370. ~~~~
  371. Default: ``''`` (Empty string)
  372. The username to use when connecting to the database. Not used with SQLite.
  373. .. setting:: TEST_CHARSET
  374. TEST_CHARSET
  375. ~~~~~~~~~~~~
  376. Default: ``None``
  377. The character set encoding used to create the test database. The value of this
  378. string is passed directly through to the database, so its format is
  379. backend-specific.
  380. Supported for the PostgreSQL_ (``postgresql_psycopg2``) and MySQL_ (``mysql``)
  381. backends.
  382. .. _PostgreSQL: http://www.postgresql.org/docs/current/static/multibyte.html
  383. .. _MySQL: http://dev.mysql.com/doc/refman/5.0/en/charset-database.html
  384. .. setting:: TEST_COLLATION
  385. TEST_COLLATION
  386. ~~~~~~~~~~~~~~
  387. Default: ``None``
  388. The collation order to use when creating the test database. This value is
  389. passed directly to the backend, so its format is backend-specific.
  390. Only supported for the ``mysql`` backend (see the `MySQL manual`_ for details).
  391. .. _MySQL manual: MySQL_
  392. .. setting:: TEST_DEPENDENCIES
  393. TEST_DEPENDENCIES
  394. ~~~~~~~~~~~~~~~~~
  395. Default: ``['default']``, for all databases other than ``default``,
  396. which has no dependencies.
  397. The creation-order dependencies of the database. See the documentation
  398. on :ref:`controlling the creation order of test databases
  399. <topics-testing-creation-dependencies>` for details.
  400. .. setting:: TEST_MIRROR
  401. TEST_MIRROR
  402. ~~~~~~~~~~~
  403. Default: ``None``
  404. The alias of the database that this database should mirror during
  405. testing.
  406. This setting exists to allow for testing of master/slave
  407. configurations of multiple databases. See the documentation on
  408. :ref:`testing master/slave configurations
  409. <topics-testing-masterslave>` for details.
  410. .. setting:: TEST_NAME
  411. TEST_NAME
  412. ~~~~~~~~~
  413. Default: ``None``
  414. The name of database to use when running the test suite.
  415. If the default value (``None``) is used with the SQLite database engine, the
  416. tests will use a memory resident database. For all other database engines the
  417. test database will use the name ``'test_' + DATABASE_NAME``.
  418. See :ref:`the-test-database`.
  419. .. setting:: TEST_CREATE
  420. TEST_CREATE
  421. ~~~~~~~~~~~
  422. Default: ``True``
  423. This is an Oracle-specific setting.
  424. If it is set to ``False``, the test tablespaces won't be automatically created
  425. at the beginning of the tests and dropped at the end.
  426. .. setting:: TEST_USER
  427. TEST_USER
  428. ~~~~~~~~~
  429. Default: ``None``
  430. This is an Oracle-specific setting.
  431. The username to use when connecting to the Oracle database that will be used
  432. when running tests. If not provided, Django will use ``'test_' + USER``.
  433. .. setting:: TEST_USER_CREATE
  434. TEST_USER_CREATE
  435. ~~~~~~~~~~~~~~~~
  436. Default: ``True``
  437. This is an Oracle-specific setting.
  438. If it is set to ``False``, the test user won't be automatically created at the
  439. beginning of the tests and dropped at the end.
  440. .. setting:: TEST_PASSWD
  441. TEST_PASSWD
  442. ~~~~~~~~~~~
  443. Default: ``None``
  444. This is an Oracle-specific setting.
  445. The password to use when connecting to the Oracle database that will be used
  446. when running tests. If not provided, Django will use a hardcoded default value.
  447. .. setting:: TEST_TBLSPACE
  448. TEST_TBLSPACE
  449. ~~~~~~~~~~~~~
  450. Default: ``None``
  451. This is an Oracle-specific setting.
  452. The name of the tablespace that will be used when running tests. If not
  453. provided, Django will use ``'test_' + NAME``.
  454. .. setting:: TEST_TBLSPACE_TMP
  455. TEST_TBLSPACE_TMP
  456. ~~~~~~~~~~~~~~~~~
  457. Default: ``None``
  458. This is an Oracle-specific setting.
  459. The name of the temporary tablespace that will be used when running tests. If
  460. not provided, Django will use ``'test_' + NAME + '_temp'``.
  461. .. setting:: DATABASE_ROUTERS
  462. DATABASE_ROUTERS
  463. ----------------
  464. Default: ``[]`` (Empty list)
  465. The list of routers that will be used to determine which database
  466. to use when performing a database queries.
  467. See the documentation on :ref:`automatic database routing in multi
  468. database configurations <topics-db-multi-db-routing>`.
  469. .. setting:: DATE_FORMAT
  470. DATE_FORMAT
  471. -----------
  472. Default: ``'N j, Y'`` (e.g. ``Feb. 4, 2003``)
  473. The default formatting to use for displaying date fields in any part of the
  474. system. Note that if :setting:`USE_L10N` is set to ``True``, then the
  475. locale-dictated format has higher precedence and will be applied instead. See
  476. :tfilter:`allowed date format strings <date>`.
  477. See also :setting:`DATETIME_FORMAT`, :setting:`TIME_FORMAT` and :setting:`SHORT_DATE_FORMAT`.
  478. .. setting:: DATE_INPUT_FORMATS
  479. DATE_INPUT_FORMATS
  480. ------------------
  481. Default::
  482. (
  483. '%Y-%m-%d', '%m/%d/%Y', '%m/%d/%y', # '2006-10-25', '10/25/2006', '10/25/06'
  484. '%b %d %Y', '%b %d, %Y', # 'Oct 25 2006', 'Oct 25, 2006'
  485. '%d %b %Y', '%d %b, %Y', # '25 Oct 2006', '25 Oct, 2006'
  486. '%B %d %Y', '%B %d, %Y', # 'October 25 2006', 'October 25, 2006'
  487. '%d %B %Y', '%d %B, %Y', # '25 October 2006', '25 October, 2006'
  488. )
  489. A tuple of formats that will be accepted when inputting data on a date field.
  490. Formats will be tried in order, using the first valid one. Note that these
  491. format strings use Python's datetime_ module syntax, not the format strings
  492. from the ``date`` Django template tag.
  493. When :setting:`USE_L10N` is ``True``, the locale-dictated format has higher
  494. precedence and will be applied instead.
  495. See also :setting:`DATETIME_INPUT_FORMATS` and :setting:`TIME_INPUT_FORMATS`.
  496. .. _datetime: http://docs.python.org/library/datetime.html#strftime-strptime-behavior
  497. .. setting:: DATETIME_FORMAT
  498. DATETIME_FORMAT
  499. ---------------
  500. Default: ``'N j, Y, P'`` (e.g. ``Feb. 4, 2003, 4 p.m.``)
  501. The default formatting to use for displaying datetime fields in any part of the
  502. system. Note that if :setting:`USE_L10N` is set to ``True``, then the
  503. locale-dictated format has higher precedence and will be applied instead. See
  504. :tfilter:`allowed date format strings <date>`.
  505. See also :setting:`DATE_FORMAT`, :setting:`TIME_FORMAT` and :setting:`SHORT_DATETIME_FORMAT`.
  506. .. setting:: DATETIME_INPUT_FORMATS
  507. DATETIME_INPUT_FORMATS
  508. ----------------------
  509. Default::
  510. (
  511. '%Y-%m-%d %H:%M:%S', # '2006-10-25 14:30:59'
  512. '%Y-%m-%d %H:%M:%S.%f', # '2006-10-25 14:30:59.000200'
  513. '%Y-%m-%d %H:%M', # '2006-10-25 14:30'
  514. '%Y-%m-%d', # '2006-10-25'
  515. '%m/%d/%Y %H:%M:%S', # '10/25/2006 14:30:59'
  516. '%m/%d/%Y %H:%M:%S.%f', # '10/25/2006 14:30:59.000200'
  517. '%m/%d/%Y %H:%M', # '10/25/2006 14:30'
  518. '%m/%d/%Y', # '10/25/2006'
  519. '%m/%d/%y %H:%M:%S', # '10/25/06 14:30:59'
  520. '%m/%d/%y %H:%M:%S.%f', # '10/25/06 14:30:59.000200'
  521. '%m/%d/%y %H:%M', # '10/25/06 14:30'
  522. '%m/%d/%y', # '10/25/06'
  523. )
  524. A tuple of formats that will be accepted when inputting data on a datetime
  525. field. Formats will be tried in order, using the first valid one. Note that
  526. these format strings use Python's datetime_ module syntax, not the format
  527. strings from the ``date`` Django template tag.
  528. When :setting:`USE_L10N` is ``True``, the locale-dictated format has higher
  529. precedence and will be applied instead.
  530. See also :setting:`DATE_INPUT_FORMATS` and :setting:`TIME_INPUT_FORMATS`.
  531. .. _datetime: http://docs.python.org/library/datetime.html#strftime-strptime-behavior
  532. .. setting:: DEBUG
  533. DEBUG
  534. -----
  535. Default: ``False``
  536. A boolean that turns on/off debug mode.
  537. Never deploy a site into production with :setting:`DEBUG` turned on.
  538. Did you catch that? NEVER deploy a site into production with :setting:`DEBUG`
  539. turned on.
  540. One of the main features of debug mode is the display of detailed error pages.
  541. If your app raises an exception when :setting:`DEBUG` is ``True``, Django will
  542. display a detailed traceback, including a lot of metadata about your
  543. environment, such as all the currently defined Django settings (from
  544. ``settings.py``).
  545. As a security measure, Django will *not* include settings that might be
  546. sensitive (or offensive), such as :setting:`SECRET_KEY` or
  547. :setting:`PROFANITIES_LIST`. Specifically, it will exclude any setting whose
  548. name includes any of the following:
  549. * ``'API'``
  550. * ``'KEY'``
  551. * ``'PASS'``
  552. * ``'PROFANITIES_LIST'``
  553. * ``'SECRET'``
  554. * ``'SIGNATURE'``
  555. * ``'TOKEN'``
  556. Note that these are *partial* matches. ``'PASS'`` will also match PASSWORD,
  557. just as ``'TOKEN'`` will also match TOKENIZED and so on.
  558. Still, note that there are always going to be sections of your debug output
  559. that are inappropriate for public consumption. File paths, configuration
  560. options and the like all give attackers extra information about your server.
  561. It is also important to remember that when running with :setting:`DEBUG`
  562. turned on, Django will remember every SQL query it executes. This is useful
  563. when you're debugging, but it'll rapidly consume memory on a production server.
  564. Finally, if :setting:`DEBUG` is ``False``, you also need to properly set
  565. the :setting:`ALLOWED_HOSTS` setting. Failing to do so will result in all
  566. requests being returned as "Bad Request (400)".
  567. .. _django/views/debug.py: https://github.com/django/django/blob/master/django/views/debug.py
  568. .. setting:: DEBUG_PROPAGATE_EXCEPTIONS
  569. DEBUG_PROPAGATE_EXCEPTIONS
  570. --------------------------
  571. Default: ``False``
  572. If set to True, Django's normal exception handling of view functions
  573. will be suppressed, and exceptions will propagate upwards. This can
  574. be useful for some test setups, and should never be used on a live
  575. site.
  576. .. setting:: DECIMAL_SEPARATOR
  577. DECIMAL_SEPARATOR
  578. -----------------
  579. Default: ``'.'`` (Dot)
  580. Default decimal separator used when formatting decimal numbers.
  581. Note that if :setting:`USE_L10N` is set to ``True``, then the locale-dictated
  582. format has higher precedence and will be applied instead.
  583. See also :setting:`NUMBER_GROUPING`, :setting:`THOUSAND_SEPARATOR` and
  584. :setting:`USE_THOUSAND_SEPARATOR`.
  585. .. setting:: DEFAULT_CHARSET
  586. DEFAULT_CHARSET
  587. ---------------
  588. Default: ``'utf-8'``
  589. Default charset to use for all ``HttpResponse`` objects, if a MIME type isn't
  590. manually specified. Used with :setting:`DEFAULT_CONTENT_TYPE` to construct the
  591. ``Content-Type`` header.
  592. .. setting:: DEFAULT_CONTENT_TYPE
  593. DEFAULT_CONTENT_TYPE
  594. --------------------
  595. Default: ``'text/html'``
  596. Default content type to use for all ``HttpResponse`` objects, if a MIME type
  597. isn't manually specified. Used with :setting:`DEFAULT_CHARSET` to construct
  598. the ``Content-Type`` header.
  599. .. setting:: DEFAULT_EXCEPTION_REPORTER_FILTER
  600. DEFAULT_EXCEPTION_REPORTER_FILTER
  601. ---------------------------------
  602. Default: :class:`django.views.debug.SafeExceptionReporterFilter`
  603. Default exception reporter filter class to be used if none has been assigned to
  604. the :class:`~django.http.HttpRequest` instance yet.
  605. See :ref:`Filtering error reports<filtering-error-reports>`.
  606. .. setting:: DEFAULT_FILE_STORAGE
  607. DEFAULT_FILE_STORAGE
  608. --------------------
  609. Default: :class:`django.core.files.storage.FileSystemStorage`
  610. Default file storage class to be used for any file-related operations that don't
  611. specify a particular storage system. See :doc:`/topics/files`.
  612. .. setting:: DEFAULT_FROM_EMAIL
  613. DEFAULT_FROM_EMAIL
  614. ------------------
  615. Default: ``'webmaster@localhost'``
  616. Default email address to use for various automated correspondence from the
  617. site manager(s).
  618. .. setting:: DEFAULT_INDEX_TABLESPACE
  619. DEFAULT_INDEX_TABLESPACE
  620. ------------------------
  621. Default: ``''`` (Empty string)
  622. Default tablespace to use for indexes on fields that don't specify
  623. one, if the backend supports it (see :doc:`/topics/db/tablespaces`).
  624. .. setting:: DEFAULT_TABLESPACE
  625. DEFAULT_TABLESPACE
  626. ------------------
  627. Default: ``''`` (Empty string)
  628. Default tablespace to use for models that don't specify one, if the
  629. backend supports it (see :doc:`/topics/db/tablespaces`).
  630. .. setting:: DISALLOWED_USER_AGENTS
  631. DISALLOWED_USER_AGENTS
  632. ----------------------
  633. Default: ``()`` (Empty tuple)
  634. List of compiled regular expression objects representing User-Agent strings that
  635. are not allowed to visit any page, systemwide. Use this for bad robots/crawlers.
  636. This is only used if ``CommonMiddleware`` is installed (see
  637. :doc:`/topics/http/middleware`).
  638. .. setting:: EMAIL_BACKEND
  639. EMAIL_BACKEND
  640. -------------
  641. Default: ``'django.core.mail.backends.smtp.EmailBackend'``
  642. The backend to use for sending emails. For the list of available backends see
  643. :doc:`/topics/email`.
  644. .. setting:: EMAIL_FILE_PATH
  645. EMAIL_FILE_PATH
  646. ---------------
  647. Default: Not defined
  648. The directory used by the ``file`` email backend to store output files.
  649. .. setting:: EMAIL_HOST
  650. EMAIL_HOST
  651. ----------
  652. Default: ``'localhost'``
  653. The host to use for sending email.
  654. See also :setting:`EMAIL_PORT`.
  655. .. setting:: EMAIL_HOST_PASSWORD
  656. EMAIL_HOST_PASSWORD
  657. -------------------
  658. Default: ``''`` (Empty string)
  659. Password to use for the SMTP server defined in :setting:`EMAIL_HOST`. This
  660. setting is used in conjunction with :setting:`EMAIL_HOST_USER` when
  661. authenticating to the SMTP server. If either of these settings is empty,
  662. Django won't attempt authentication.
  663. See also :setting:`EMAIL_HOST_USER`.
  664. .. setting:: EMAIL_HOST_USER
  665. EMAIL_HOST_USER
  666. ---------------
  667. Default: ``''`` (Empty string)
  668. Username to use for the SMTP server defined in :setting:`EMAIL_HOST`.
  669. If empty, Django won't attempt authentication.
  670. See also :setting:`EMAIL_HOST_PASSWORD`.
  671. .. setting:: EMAIL_PORT
  672. EMAIL_PORT
  673. ----------
  674. Default: ``25``
  675. Port to use for the SMTP server defined in :setting:`EMAIL_HOST`.
  676. .. setting:: EMAIL_SUBJECT_PREFIX
  677. EMAIL_SUBJECT_PREFIX
  678. --------------------
  679. Default: ``'[Django] '``
  680. Subject-line prefix for email messages sent with ``django.core.mail.mail_admins``
  681. or ``django.core.mail.mail_managers``. You'll probably want to include the
  682. trailing space.
  683. .. setting:: EMAIL_USE_TLS
  684. EMAIL_USE_TLS
  685. -------------
  686. Default: ``False``
  687. Whether to use a TLS (secure) connection when talking to the SMTP server.
  688. This is used for explicit TLS connections, generally on port 587. If you are
  689. experiencing hanging connections, see the implicit TLS setting
  690. :setting:`EMAIL_USE_SSL`.
  691. .. setting:: EMAIL_USE_SSL
  692. EMAIL_USE_SSL
  693. -------------
  694. .. versionadded:: 1.7
  695. Default: ``False``
  696. Whether to use an implicit TLS (secure) connection when talking to the SMTP
  697. server. In most email documentation this type of TLS connection is referred
  698. to as SSL. It is generally used on port 465. If you are experiencing problems,
  699. see the explicit TLS setting :setting:`EMAIL_USE_TLS`.
  700. Note that :setting:`EMAIL_USE_TLS`/:setting:`EMAIL_USE_SSL` are mutually
  701. exclusive, so only set one of those settings to ``True``.
  702. .. setting:: FILE_CHARSET
  703. FILE_CHARSET
  704. ------------
  705. Default: ``'utf-8'``
  706. The character encoding used to decode any files read from disk. This includes
  707. template files and initial SQL data files.
  708. .. setting:: FILE_UPLOAD_HANDLERS
  709. FILE_UPLOAD_HANDLERS
  710. --------------------
  711. Default::
  712. ("django.core.files.uploadhandler.MemoryFileUploadHandler",
  713. "django.core.files.uploadhandler.TemporaryFileUploadHandler",)
  714. A tuple of handlers to use for uploading. See :doc:`/topics/files` for details.
  715. .. setting:: FILE_UPLOAD_MAX_MEMORY_SIZE
  716. FILE_UPLOAD_MAX_MEMORY_SIZE
  717. ---------------------------
  718. Default: ``2621440`` (i.e. 2.5 MB).
  719. The maximum size (in bytes) that an upload will be before it gets streamed to
  720. the file system. See :doc:`/topics/files` for details.
  721. .. setting:: FILE_UPLOAD_PERMISSIONS
  722. FILE_UPLOAD_PERMISSIONS
  723. -----------------------
  724. Default: ``None``
  725. The numeric mode (i.e. ``0644``) to set newly uploaded files to. For
  726. more information about what these modes mean, see the documentation for
  727. :func:`os.chmod`.
  728. If this isn't given or is ``None``, you'll get operating-system
  729. dependent behavior. On most platforms, temporary files will have a mode
  730. of ``0600``, and files saved from memory will be saved using the
  731. system's standard umask.
  732. .. warning::
  733. **Always prefix the mode with a 0.**
  734. If you're not familiar with file modes, please note that the leading
  735. ``0`` is very important: it indicates an octal number, which is the
  736. way that modes must be specified. If you try to use ``644``, you'll
  737. get totally incorrect behavior.
  738. .. setting:: FILE_UPLOAD_TEMP_DIR
  739. FILE_UPLOAD_TEMP_DIR
  740. --------------------
  741. Default: ``None``
  742. The directory to store data temporarily while uploading files. If ``None``,
  743. Django will use the standard temporary directory for the operating system. For
  744. example, this will default to '/tmp' on \*nix-style operating systems.
  745. See :doc:`/topics/files` for details.
  746. .. setting:: FIRST_DAY_OF_WEEK
  747. FIRST_DAY_OF_WEEK
  748. -----------------
  749. Default: ``0`` (Sunday)
  750. Number representing the first day of the week. This is especially useful
  751. when displaying a calendar. This value is only used when not using
  752. format internationalization, or when a format cannot be found for the
  753. current locale.
  754. The value must be an integer from 0 to 6, where 0 means Sunday, 1 means
  755. Monday and so on.
  756. .. setting:: FIXTURE_DIRS
  757. FIXTURE_DIRS
  758. -------------
  759. Default: ``()`` (Empty tuple)
  760. List of directories searched for fixture files, in addition to the
  761. ``fixtures`` directory of each application, in search order.
  762. Note that these paths should use Unix-style forward slashes, even on Windows.
  763. See :ref:`initial-data-via-fixtures` and :ref:`topics-testing-fixtures`.
  764. .. setting:: FORCE_SCRIPT_NAME
  765. FORCE_SCRIPT_NAME
  766. ------------------
  767. Default: ``None``
  768. If not ``None``, this will be used as the value of the ``SCRIPT_NAME``
  769. environment variable in any HTTP request. This setting can be used to override
  770. the server-provided value of ``SCRIPT_NAME``, which may be a rewritten version
  771. of the preferred value or not supplied at all.
  772. .. setting:: FORMAT_MODULE_PATH
  773. FORMAT_MODULE_PATH
  774. ------------------
  775. Default: ``None``
  776. A full Python path to a Python package that contains format definitions for
  777. project locales. If not ``None``, Django will check for a ``formats.py``
  778. file, under the directory named as the current locale, and will use the
  779. formats defined on this file.
  780. For example, if :setting:`FORMAT_MODULE_PATH` is set to ``mysite.formats``,
  781. and current language is ``en`` (English), Django will expect a directory tree
  782. like::
  783. mysite/
  784. formats/
  785. __init__.py
  786. en/
  787. __init__.py
  788. formats.py
  789. Available formats are :setting:`DATE_FORMAT`, :setting:`TIME_FORMAT`,
  790. :setting:`DATETIME_FORMAT`, :setting:`YEAR_MONTH_FORMAT`,
  791. :setting:`MONTH_DAY_FORMAT`, :setting:`SHORT_DATE_FORMAT`,
  792. :setting:`SHORT_DATETIME_FORMAT`, :setting:`FIRST_DAY_OF_WEEK`,
  793. :setting:`DECIMAL_SEPARATOR`, :setting:`THOUSAND_SEPARATOR` and
  794. :setting:`NUMBER_GROUPING`.
  795. .. setting:: IGNORABLE_404_URLS
  796. IGNORABLE_404_URLS
  797. ------------------
  798. Default: ``()``
  799. List of compiled regular expression objects describing URLs that should be
  800. ignored when reporting HTTP 404 errors via email (see
  801. :doc:`/howto/error-reporting`). Regular expressions are matched against
  802. :meth:`request's full paths <django.http.HttpRequest.get_full_path>` (including
  803. query string, if any). Use this if your site does not provide a commonly
  804. requested file such as ``favicon.ico`` or ``robots.txt``, or if it gets
  805. hammered by script kiddies.
  806. This is only used if
  807. :class:`~django.middleware.common.BrokenLinkEmailsMiddleware` is enabled (see
  808. :doc:`/topics/http/middleware`).
  809. .. setting:: INSTALLED_APPS
  810. INSTALLED_APPS
  811. --------------
  812. Default: ``()`` (Empty tuple)
  813. A tuple of strings designating all applications that are enabled in this Django
  814. installation. Each string should be a full Python path to a Python package that
  815. contains a Django application, as created by :djadmin:`django-admin.py startapp
  816. <startapp>`.
  817. .. admonition:: App names must be unique
  818. The application names (that is, the final dotted part of the
  819. path to the module containing ``models.py``) defined in
  820. :setting:`INSTALLED_APPS` *must* be unique. For example, you can't
  821. include both ``django.contrib.auth`` and ``myproject.auth`` in
  822. INSTALLED_APPS.
  823. .. setting:: INTERNAL_IPS
  824. INTERNAL_IPS
  825. ------------
  826. Default: ``()`` (Empty tuple)
  827. A tuple of IP addresses, as strings, that:
  828. * See debug comments, when :setting:`DEBUG` is ``True``
  829. * Receive X headers in admindocs if the ``XViewMiddleware`` is installed (see
  830. :doc:`/topics/http/middleware`)
  831. .. setting:: LANGUAGE_CODE
  832. LANGUAGE_CODE
  833. -------------
  834. Default: ``'en-us'``
  835. A string representing the language code for this installation. This should be
  836. in standard :term:`language format<language code>`. For example, U.S. English
  837. is ``"en-us"``. See also the `list of language identifiers`_ and
  838. :doc:`/topics/i18n/index`.
  839. .. _list of language identifiers: http://www.i18nguy.com/unicode/language-identifiers.html
  840. .. setting:: LANGUAGE_COOKIE_NAME
  841. LANGUAGE_COOKIE_NAME
  842. --------------------
  843. Default: ``'django_language'``
  844. The name of the cookie to use for the language cookie. This can be whatever
  845. you want (but should be different from :setting:`SESSION_COOKIE_NAME`). See
  846. :doc:`/topics/i18n/index`.
  847. .. setting:: LANGUAGES
  848. LANGUAGES
  849. ---------
  850. Default: A tuple of all available languages. This list is continually growing
  851. and including a copy here would inevitably become rapidly out of date. You can
  852. see the current list of translated languages by looking in
  853. ``django/conf/global_settings.py`` (or view the `online source`_).
  854. .. _online source: https://github.com/django/django/blob/master/django/conf/global_settings.py
  855. The list is a tuple of two-tuples in the format
  856. (:term:`language code<language code>`, ``language name``) -- for example,
  857. ``('ja', 'Japanese')``.
  858. This specifies which languages are available for language selection. See
  859. :doc:`/topics/i18n/index`.
  860. Generally, the default value should suffice. Only set this setting if you want
  861. to restrict language selection to a subset of the Django-provided languages.
  862. If you define a custom :setting:`LANGUAGES` setting, it's OK to mark the
  863. languages as translation strings (as in the default value referred to above)
  864. -- but use a "dummy" ``gettext()`` function, not the one in
  865. ``django.utils.translation``. You should *never* import
  866. ``django.utils.translation`` from within your settings file, because that
  867. module in itself depends on the settings, and that would cause a circular
  868. import.
  869. The solution is to use a "dummy" ``gettext()`` function. Here's a sample
  870. settings file::
  871. gettext = lambda s: s
  872. LANGUAGES = (
  873. ('de', gettext('German')),
  874. ('en', gettext('English')),
  875. )
  876. With this arrangement, ``django-admin.py makemessages`` will still find and
  877. mark these strings for translation, but the translation won't happen at
  878. runtime -- so you'll have to remember to wrap the languages in the *real*
  879. ``gettext()`` in any code that uses :setting:`LANGUAGES` at runtime.
  880. .. setting:: LOCALE_PATHS
  881. LOCALE_PATHS
  882. ------------
  883. Default: ``()`` (Empty tuple)
  884. A tuple of directories where Django looks for translation files.
  885. See :ref:`how-django-discovers-translations`.
  886. Example::
  887. LOCALE_PATHS = (
  888. '/home/www/project/common_files/locale',
  889. '/var/local/translations/locale'
  890. )
  891. Django will look within each of these paths for the ``<locale_code>/LC_MESSAGES``
  892. directories containing the actual translation files.
  893. .. setting:: LOGGING
  894. LOGGING
  895. -------
  896. Default: A logging configuration dictionary.
  897. A data structure containing configuration information. The contents of
  898. this data structure will be passed as the argument to the
  899. configuration method described in :setting:`LOGGING_CONFIG`.
  900. Among other things, the default logging configuration passes HTTP 500 server
  901. errors to an email log handler when :setting:`DEBUG` is ``False``. See also
  902. :ref:`configuring-logging`.
  903. You can see the default logging configuration by looking in
  904. ``django/utils/log.py`` (or view the `online source`__).
  905. __ https://github.com/django/django/blob/master/django/utils/log.py
  906. .. setting:: LOGGING_CONFIG
  907. LOGGING_CONFIG
  908. --------------
  909. Default: ``'logging.config.dictConfig'``
  910. A path to a callable that will be used to configure logging in the
  911. Django project. Points at a instance of Python's `dictConfig`_
  912. configuration method by default.
  913. If you set :setting:`LOGGING_CONFIG` to ``None``, the logging
  914. configuration process will be skipped.
  915. .. versionchanged:: 1.7
  916. Previously, the default value was ``'django.utils.log.dictConfig'``.
  917. .. _dictConfig: http://docs.python.org/library/logging.config.html#configuration-dictionary-schema
  918. .. setting:: MANAGERS
  919. MANAGERS
  920. --------
  921. Default: ``()`` (Empty tuple)
  922. A tuple in the same format as :setting:`ADMINS` that specifies who should get
  923. broken link notifications when
  924. :class:`~django.middleware.common.BrokenLinkEmailsMiddleware` is enabled.
  925. .. setting:: MEDIA_ROOT
  926. MEDIA_ROOT
  927. ----------
  928. Default: ``''`` (Empty string)
  929. Absolute filesystem path to the directory that will hold :doc:`user-uploaded
  930. files </topics/files>`.
  931. Example: ``"/var/www/example.com/media/"``
  932. See also :setting:`MEDIA_URL`.
  933. .. setting:: MEDIA_URL
  934. MEDIA_URL
  935. ---------
  936. Default: ``''`` (Empty string)
  937. URL that handles the media served from :setting:`MEDIA_ROOT`, used
  938. for :doc:`managing stored files </topics/files>`. It must end in a slash if set
  939. to a non-empty value.
  940. Example: ``"http://media.example.com/"``
  941. .. setting:: MIDDLEWARE_CLASSES
  942. MIDDLEWARE_CLASSES
  943. ------------------
  944. Default::
  945. ('django.middleware.common.CommonMiddleware',
  946. 'django.contrib.sessions.middleware.SessionMiddleware',
  947. 'django.middleware.csrf.CsrfViewMiddleware',
  948. 'django.contrib.auth.middleware.AuthenticationMiddleware',
  949. 'django.contrib.messages.middleware.MessageMiddleware',)
  950. A tuple of middleware classes to use. See :doc:`/topics/http/middleware`.
  951. .. setting:: MONTH_DAY_FORMAT
  952. MONTH_DAY_FORMAT
  953. ----------------
  954. Default: ``'F j'``
  955. The default formatting to use for date fields on Django admin change-list
  956. pages -- and, possibly, by other parts of the system -- in cases when only the
  957. month and day are displayed.
  958. For example, when a Django admin change-list page is being filtered by a date
  959. drilldown, the header for a given day displays the day and month. Different
  960. locales have different formats. For example, U.S. English would say
  961. "January 1," whereas Spanish might say "1 Enero."
  962. See :tfilter:`allowed date format strings <date>`. See also
  963. :setting:`DATE_FORMAT`, :setting:`DATETIME_FORMAT`,
  964. :setting:`TIME_FORMAT` and :setting:`YEAR_MONTH_FORMAT`.
  965. .. setting:: NUMBER_GROUPING
  966. NUMBER_GROUPING
  967. ----------------
  968. Default: ``0``
  969. Number of digits grouped together on the integer part of a number.
  970. Common use is to display a thousand separator. If this setting is ``0``, then
  971. no grouping will be applied to the number. If this setting is greater than
  972. ``0``, then :setting:`THOUSAND_SEPARATOR` will be used as the separator between
  973. those groups.
  974. Note that if :setting:`USE_L10N` is set to ``True``, then the locale-dictated
  975. format has higher precedence and will be applied instead.
  976. See also :setting:`DECIMAL_SEPARATOR`, :setting:`THOUSAND_SEPARATOR` and
  977. :setting:`USE_THOUSAND_SEPARATOR`.
  978. .. setting:: PREPEND_WWW
  979. PREPEND_WWW
  980. -----------
  981. Default: ``False``
  982. Whether to prepend the "www." subdomain to URLs that don't have it. This is only
  983. used if :class:`~django.middleware.common.CommonMiddleware` is installed
  984. (see :doc:`/topics/http/middleware`). See also :setting:`APPEND_SLASH`.
  985. .. setting:: ROOT_URLCONF
  986. ROOT_URLCONF
  987. ------------
  988. Default: Not defined
  989. A string representing the full Python import path to your root URLconf. For example:
  990. ``"mydjangoapps.urls"``. Can be overridden on a per-request basis by
  991. setting the attribute ``urlconf`` on the incoming ``HttpRequest``
  992. object. See :ref:`how-django-processes-a-request` for details.
  993. .. setting:: SECRET_KEY
  994. SECRET_KEY
  995. ----------
  996. Default: ``''`` (Empty string)
  997. A secret key for a particular Django installation. This is used to provide
  998. :doc:`cryptographic signing </topics/signing>`, and should be set to a unique,
  999. unpredictable value.
  1000. :djadmin:`django-admin.py startproject <startproject>` automatically adds a
  1001. randomly-generated ``SECRET_KEY`` to each new project.
  1002. .. warning::
  1003. **Keep this value secret.**
  1004. Running Django with a known :setting:`SECRET_KEY` defeats many of Django's
  1005. security protections, and can lead to privilege escalation and remote code
  1006. execution vulnerabilities.
  1007. .. versionchanged:: 1.5
  1008. Django will now refuse to start if :setting:`SECRET_KEY` is not set.
  1009. .. setting:: SECURE_PROXY_SSL_HEADER
  1010. SECURE_PROXY_SSL_HEADER
  1011. -----------------------
  1012. Default: ``None``
  1013. A tuple representing a HTTP header/value combination that signifies a request
  1014. is secure. This controls the behavior of the request object's ``is_secure()``
  1015. method.
  1016. This takes some explanation. By default, ``is_secure()`` is able to determine
  1017. whether a request is secure by looking at whether the requested URL uses
  1018. "https://". This is important for Django's CSRF protection, and may be used
  1019. by your own code or third-party apps.
  1020. If your Django app is behind a proxy, though, the proxy may be "swallowing" the
  1021. fact that a request is HTTPS, using a non-HTTPS connection between the proxy
  1022. and Django. In this case, ``is_secure()`` would always return ``False`` -- even
  1023. for requests that were made via HTTPS by the end user.
  1024. In this situation, you'll want to configure your proxy to set a custom HTTP
  1025. header that tells Django whether the request came in via HTTPS, and you'll want
  1026. to set ``SECURE_PROXY_SSL_HEADER`` so that Django knows what header to look
  1027. for.
  1028. You'll need to set a tuple with two elements -- the name of the header to look
  1029. for and the required value. For example::
  1030. SECURE_PROXY_SSL_HEADER = ('HTTP_X_FORWARDED_PROTO', 'https')
  1031. Here, we're telling Django that we trust the ``X-Forwarded-Proto`` header
  1032. that comes from our proxy, and any time its value is ``'https'``, then the
  1033. request is guaranteed to be secure (i.e., it originally came in via HTTPS).
  1034. Obviously, you should *only* set this setting if you control your proxy or
  1035. have some other guarantee that it sets/strips this header appropriately.
  1036. Note that the header needs to be in the format as used by ``request.META`` --
  1037. all caps and likely starting with ``HTTP_``. (Remember, Django automatically
  1038. adds ``'HTTP_'`` to the start of x-header names before making the header
  1039. available in ``request.META``.)
  1040. .. warning::
  1041. **You will probably open security holes in your site if you set this
  1042. without knowing what you're doing. And if you fail to set it when you
  1043. should. Seriously.**
  1044. Make sure ALL of the following are true before setting this (assuming the
  1045. values from the example above):
  1046. * Your Django app is behind a proxy.
  1047. * Your proxy strips the ``X-Forwarded-Proto`` header from all incoming
  1048. requests. In other words, if end users include that header in their
  1049. requests, the proxy will discard it.
  1050. * Your proxy sets the ``X-Forwarded-Proto`` header and sends it to Django,
  1051. but only for requests that originally come in via HTTPS.
  1052. If any of those are not true, you should keep this setting set to ``None``
  1053. and find another way of determining HTTPS, perhaps via custom middleware.
  1054. .. setting:: SEND_BROKEN_LINK_EMAILS
  1055. SEND_BROKEN_LINK_EMAILS
  1056. -----------------------
  1057. .. deprecated:: 1.6
  1058. Since :class:`~django.middleware.common.BrokenLinkEmailsMiddleware`
  1059. was split from :class:`~django.middleware.common.CommonMiddleware`,
  1060. this setting no longer serves a purpose.
  1061. Default: ``False``
  1062. Whether to send an email to the :setting:`MANAGERS` each time somebody visits
  1063. a Django-powered page that is 404ed with a non-empty referer (i.e., a broken
  1064. link). This is only used if ``CommonMiddleware`` is installed (see
  1065. :doc:`/topics/http/middleware`). See also :setting:`IGNORABLE_404_URLS` and
  1066. :doc:`/howto/error-reporting`.
  1067. .. setting:: SERIALIZATION_MODULES
  1068. SERIALIZATION_MODULES
  1069. ---------------------
  1070. Default: Not defined.
  1071. A dictionary of modules containing serializer definitions (provided as
  1072. strings), keyed by a string identifier for that serialization type. For
  1073. example, to define a YAML serializer, use::
  1074. SERIALIZATION_MODULES = { 'yaml' : 'path.to.yaml_serializer' }
  1075. .. setting:: SERVER_EMAIL
  1076. SERVER_EMAIL
  1077. ------------
  1078. Default: ``'root@localhost'``
  1079. The email address that error messages come from, such as those sent to
  1080. :setting:`ADMINS` and :setting:`MANAGERS`.
  1081. .. setting:: SHORT_DATE_FORMAT
  1082. SHORT_DATE_FORMAT
  1083. -----------------
  1084. Default: ``m/d/Y`` (e.g. ``12/31/2003``)
  1085. An available formatting that can be used for displaying date fields on
  1086. templates. Note that if :setting:`USE_L10N` is set to ``True``, then the
  1087. corresponding locale-dictated format has higher precedence and will be applied.
  1088. See :tfilter:`allowed date format strings <date>`.
  1089. See also :setting:`DATE_FORMAT` and :setting:`SHORT_DATETIME_FORMAT`.
  1090. .. setting:: SHORT_DATETIME_FORMAT
  1091. SHORT_DATETIME_FORMAT
  1092. ---------------------
  1093. Default: ``m/d/Y P`` (e.g. ``12/31/2003 4 p.m.``)
  1094. An available formatting that can be used for displaying datetime fields on
  1095. templates. Note that if :setting:`USE_L10N` is set to ``True``, then the
  1096. corresponding locale-dictated format has higher precedence and will be applied.
  1097. See :tfilter:`allowed date format strings <date>`.
  1098. See also :setting:`DATE_FORMAT` and :setting:`SHORT_DATE_FORMAT`.
  1099. .. setting:: SIGNING_BACKEND
  1100. SIGNING_BACKEND
  1101. ---------------
  1102. Default: 'django.core.signing.TimestampSigner'
  1103. The backend used for signing cookies and other data.
  1104. See also the :doc:`/topics/signing` documentation.
  1105. .. setting:: TEMPLATE_CONTEXT_PROCESSORS
  1106. TEMPLATE_CONTEXT_PROCESSORS
  1107. ---------------------------
  1108. Default::
  1109. ("django.contrib.auth.context_processors.auth",
  1110. "django.core.context_processors.debug",
  1111. "django.core.context_processors.i18n",
  1112. "django.core.context_processors.media",
  1113. "django.core.context_processors.static",
  1114. "django.core.context_processors.tz",
  1115. "django.contrib.messages.context_processors.messages")
  1116. A tuple of callables that are used to populate the context in ``RequestContext``.
  1117. These callables take a request object as their argument and return a dictionary
  1118. of items to be merged into the context.
  1119. .. setting:: TEMPLATE_DEBUG
  1120. TEMPLATE_DEBUG
  1121. --------------
  1122. Default: ``False``
  1123. A boolean that turns on/off template debug mode. If this is ``True``, the fancy
  1124. error page will display a detailed report for any exception raised during
  1125. template rendering. This report contains the relevant snippet of the template,
  1126. with the appropriate line highlighted.
  1127. Note that Django only displays fancy error pages if :setting:`DEBUG` is ``True``, so
  1128. you'll want to set that to take advantage of this setting.
  1129. See also :setting:`DEBUG`.
  1130. .. setting:: TEMPLATE_DIRS
  1131. TEMPLATE_DIRS
  1132. -------------
  1133. Default: ``()`` (Empty tuple)
  1134. List of locations of the template source files searched by
  1135. :class:`django.template.loaders.filesystem.Loader`, in search order.
  1136. Note that these paths should use Unix-style forward slashes, even on Windows.
  1137. See :doc:`/topics/templates`.
  1138. .. setting:: TEMPLATE_LOADERS
  1139. TEMPLATE_LOADERS
  1140. ----------------
  1141. Default::
  1142. ('django.template.loaders.filesystem.Loader',
  1143. 'django.template.loaders.app_directories.Loader')
  1144. A tuple of template loader classes, specified as strings. Each ``Loader`` class
  1145. knows how to import templates from a particular source. Optionally, a tuple can be
  1146. used instead of a string. The first item in the tuple should be the ``Loader``'s
  1147. module, subsequent items are passed to the ``Loader`` during initialization. See
  1148. :doc:`/ref/templates/api`.
  1149. .. setting:: TEMPLATE_STRING_IF_INVALID
  1150. TEMPLATE_STRING_IF_INVALID
  1151. --------------------------
  1152. Default: ``''`` (Empty string)
  1153. Output, as a string, that the template system should use for invalid (e.g.
  1154. misspelled) variables. See :ref:`invalid-template-variables`..
  1155. .. setting:: TEST_RUNNER
  1156. TEST_RUNNER
  1157. -----------
  1158. Default: ``'django.test.runner.DiscoverRunner'``
  1159. The name of the class to use for starting the test suite. See
  1160. :ref:`other-testing-frameworks`.
  1161. .. versionchanged:: 1.6
  1162. Previously the default ``TEST_RUNNER`` was
  1163. ``django.test.simple.DjangoTestSuiteRunner``.
  1164. .. setting:: THOUSAND_SEPARATOR
  1165. THOUSAND_SEPARATOR
  1166. ------------------
  1167. Default: ``,`` (Comma)
  1168. Default thousand separator used when formatting numbers. This setting is
  1169. used only when :setting:`USE_THOUSAND_SEPARATOR` is ``True`` and
  1170. :setting:`NUMBER_GROUPING` is greater than ``0``.
  1171. Note that if :setting:`USE_L10N` is set to ``True``, then the locale-dictated
  1172. format has higher precedence and will be applied instead.
  1173. See also :setting:`NUMBER_GROUPING`, :setting:`DECIMAL_SEPARATOR` and
  1174. :setting:`USE_THOUSAND_SEPARATOR`.
  1175. .. setting:: TIME_FORMAT
  1176. TIME_FORMAT
  1177. -----------
  1178. Default: ``'P'`` (e.g. ``4 p.m.``)
  1179. The default formatting to use for displaying time fields in any part of the
  1180. system. Note that if :setting:`USE_L10N` is set to ``True``, then the
  1181. locale-dictated format has higher precedence and will be applied instead. See
  1182. :tfilter:`allowed date format strings <date>`.
  1183. See also :setting:`DATE_FORMAT` and :setting:`DATETIME_FORMAT`.
  1184. .. setting:: TIME_INPUT_FORMATS
  1185. TIME_INPUT_FORMATS
  1186. ------------------
  1187. Default::
  1188. (
  1189. '%H:%M:%S', # '14:30:59'
  1190. '%H:%M:%S.%f', # '14:30:59.000200'
  1191. '%H:%M', # '14:30'
  1192. )
  1193. A tuple of formats that will be accepted when inputting data on a time field.
  1194. Formats will be tried in order, using the first valid one. Note that these
  1195. format strings use Python's datetime_ module syntax, not the format strings
  1196. from the ``date`` Django template tag.
  1197. When :setting:`USE_L10N` is ``True``, the locale-dictated format has higher
  1198. precedence and will be applied instead.
  1199. See also :setting:`DATE_INPUT_FORMATS` and :setting:`DATETIME_INPUT_FORMATS`.
  1200. .. versionchanged:: 1.6
  1201. Input format with microseconds has been added.
  1202. .. _datetime: http://docs.python.org/library/datetime.html#strftime-strptime-behavior
  1203. .. setting:: TIME_ZONE
  1204. TIME_ZONE
  1205. ---------
  1206. Default: ``'America/Chicago'``
  1207. A string representing the time zone for this installation, or ``None``. See
  1208. the `list of time zones`_.
  1209. .. note::
  1210. Since Django was first released with the :setting:`TIME_ZONE` set to
  1211. ``'America/Chicago'``, the global setting (used if nothing is defined in
  1212. your project's ``settings.py``) remains ``'America/Chicago'`` for backwards
  1213. compatibility. New project templates default to ``'UTC'``.
  1214. Note that this isn't necessarily the time zone of the server. For example, one
  1215. server may serve multiple Django-powered sites, each with a separate time zone
  1216. setting.
  1217. When :setting:`USE_TZ` is ``False``, this is the time zone in which Django
  1218. will store all datetimes. When :setting:`USE_TZ` is ``True``, this is the
  1219. default time zone that Django will use to display datetimes in templates and
  1220. to interpret datetimes entered in forms.
  1221. Django sets the ``os.environ['TZ']`` variable to the time zone you specify in
  1222. the :setting:`TIME_ZONE` setting. Thus, all your views and models will
  1223. automatically operate in this time zone. However, Django won't set the ``TZ``
  1224. environment variable under the following conditions:
  1225. * If you're using the manual configuration option as described in
  1226. :ref:`manually configuring settings
  1227. <settings-without-django-settings-module>`, or
  1228. * If you specify ``TIME_ZONE = None``. This will cause Django to fall back to
  1229. using the system timezone. However, this is discouraged when :setting:`USE_TZ
  1230. = True <USE_TZ>`, because it makes conversions between local time and UTC
  1231. less reliable.
  1232. If Django doesn't set the ``TZ`` environment variable, it's up to you
  1233. to ensure your processes are running in the correct environment.
  1234. .. note::
  1235. Django cannot reliably use alternate time zones in a Windows environment.
  1236. If you're running Django on Windows, :setting:`TIME_ZONE` must be set to
  1237. match the system time zone.
  1238. .. _list of time zones: http://en.wikipedia.org/wiki/List_of_tz_database_time_zones
  1239. .. _pytz: http://pytz.sourceforge.net/
  1240. .. setting:: TRANSACTIONS_MANAGED
  1241. TRANSACTIONS_MANAGED
  1242. --------------------
  1243. .. deprecated:: 1.6
  1244. This setting was deprecated because its name is very misleading. Use the
  1245. :setting:`AUTOCOMMIT <DATABASE-AUTOCOMMIT>` key in :setting:`DATABASES`
  1246. entries instead.
  1247. Default: ``False``
  1248. Set this to ``True`` if you want to :ref:`disable Django's transaction
  1249. management <deactivate-transaction-management>` and implement your own.
  1250. .. setting:: USE_ETAGS
  1251. USE_ETAGS
  1252. ---------
  1253. Default: ``False``
  1254. A boolean that specifies whether to output the "Etag" header. This saves
  1255. bandwidth but slows down performance. This is used by the ``CommonMiddleware``
  1256. (see :doc:`/topics/http/middleware`) and in the``Cache Framework``
  1257. (see :doc:`/topics/cache`).
  1258. .. setting:: USE_I18N
  1259. USE_I18N
  1260. --------
  1261. Default: ``True``
  1262. A boolean that specifies whether Django's translation system should be enabled.
  1263. This provides an easy way to turn it off, for performance. If this is set to
  1264. ``False``, Django will make some optimizations so as not to load the
  1265. translation machinery.
  1266. See also :setting:`LANGUAGE_CODE`, :setting:`USE_L10N` and :setting:`USE_TZ`.
  1267. .. setting:: USE_L10N
  1268. USE_L10N
  1269. --------
  1270. Default: ``False``
  1271. A boolean that specifies if localized formatting of data will be enabled by
  1272. default or not. If this is set to ``True``, e.g. Django will display numbers and
  1273. dates using the format of the current locale.
  1274. See also :setting:`LANGUAGE_CODE`, :setting:`USE_I18N` and :setting:`USE_TZ`.
  1275. .. note::
  1276. The default :file:`settings.py` file created by :djadmin:`django-admin.py
  1277. startproject <startproject>` includes ``USE_L10N = True`` for convenience.
  1278. .. setting:: USE_THOUSAND_SEPARATOR
  1279. USE_THOUSAND_SEPARATOR
  1280. ----------------------
  1281. Default: ``False``
  1282. A boolean that specifies whether to display numbers using a thousand separator.
  1283. When :setting:`USE_L10N` is set to ``True`` and if this is also set to
  1284. ``True``, Django will use the values of :setting:`THOUSAND_SEPARATOR` and
  1285. :setting:`NUMBER_GROUPING` to format numbers.
  1286. See also :setting:`DECIMAL_SEPARATOR`, :setting:`NUMBER_GROUPING` and
  1287. :setting:`THOUSAND_SEPARATOR`.
  1288. .. setting:: USE_TZ
  1289. USE_TZ
  1290. ------
  1291. Default: ``False``
  1292. A boolean that specifies if datetimes will be timezone-aware by default or not.
  1293. If this is set to ``True``, Django will use timezone-aware datetimes internally.
  1294. Otherwise, Django will use naive datetimes in local time.
  1295. See also :setting:`TIME_ZONE`, :setting:`USE_I18N` and :setting:`USE_L10N`.
  1296. .. note::
  1297. The default :file:`settings.py` file created by
  1298. :djadmin:`django-admin.py startproject <startproject>` includes
  1299. ``USE_TZ = True`` for convenience.
  1300. .. setting:: USE_X_FORWARDED_HOST
  1301. USE_X_FORWARDED_HOST
  1302. --------------------
  1303. Default: ``False``
  1304. A boolean that specifies whether to use the X-Forwarded-Host header in
  1305. preference to the Host header. This should only be enabled if a proxy
  1306. which sets this header is in use.
  1307. .. setting:: WSGI_APPLICATION
  1308. WSGI_APPLICATION
  1309. ----------------
  1310. Default: ``None``
  1311. The full Python path of the WSGI application object that Django's built-in
  1312. servers (e.g. :djadmin:`runserver`) will use. The :djadmin:`django-admin.py
  1313. startproject <startproject>` management command will create a simple
  1314. ``wsgi.py`` file with an ``application`` callable in it, and point this setting
  1315. to that ``application``.
  1316. If not set, the return value of ``django.core.wsgi.get_wsgi_application()``
  1317. will be used. In this case, the behavior of :djadmin:`runserver` will be
  1318. identical to previous Django versions.
  1319. .. setting:: YEAR_MONTH_FORMAT
  1320. YEAR_MONTH_FORMAT
  1321. -----------------
  1322. Default: ``'F Y'``
  1323. The default formatting to use for date fields on Django admin change-list
  1324. pages -- and, possibly, by other parts of the system -- in cases when only the
  1325. year and month are displayed.
  1326. For example, when a Django admin change-list page is being filtered by a date
  1327. drilldown, the header for a given month displays the month and the year.
  1328. Different locales have different formats. For example, U.S. English would say
  1329. "January 2006," whereas another locale might say "2006/January."
  1330. See :tfilter:`allowed date format strings <date>`. See also
  1331. :setting:`DATE_FORMAT`, :setting:`DATETIME_FORMAT`, :setting:`TIME_FORMAT`
  1332. and :setting:`MONTH_DAY_FORMAT`.
  1333. .. setting:: X_FRAME_OPTIONS
  1334. X_FRAME_OPTIONS
  1335. ---------------
  1336. Default: ``'SAMEORIGIN'``
  1337. The default value for the X-Frame-Options header used by
  1338. :class:`~django.middleware.clickjacking.XFrameOptionsMiddleware`. See the
  1339. :doc:`clickjacking protection </ref/clickjacking/>` documentation.
  1340. Admindocs
  1341. =========
  1342. Settings for :mod:`django.contrib.admindocs`.
  1343. .. setting:: ADMIN_FOR
  1344. ADMIN_FOR
  1345. ---------
  1346. Default: ``()`` (Empty tuple)
  1347. Used for admin-site settings modules, this should be a tuple of settings
  1348. modules (in the format ``'foo.bar.baz'``) for which this site is an admin.
  1349. The admin site uses this in its automatically-introspected documentation of
  1350. models, views and template tags.
  1351. Auth
  1352. ====
  1353. Settings for :mod:`django.contrib.auth`.
  1354. .. setting:: AUTHENTICATION_BACKENDS
  1355. AUTHENTICATION_BACKENDS
  1356. -----------------------
  1357. Default: ``('django.contrib.auth.backends.ModelBackend',)``
  1358. A tuple of authentication backend classes (as strings) to use when attempting to
  1359. authenticate a user. See the :ref:`authentication backends documentation
  1360. <authentication-backends>` for details.
  1361. .. setting:: AUTH_USER_MODEL
  1362. AUTH_USER_MODEL
  1363. ---------------
  1364. Default: 'auth.User'
  1365. The model to use to represent a User. See :ref:`auth-custom-user`.
  1366. .. setting:: LOGIN_REDIRECT_URL
  1367. LOGIN_REDIRECT_URL
  1368. ------------------
  1369. Default: ``'/accounts/profile/'``
  1370. The URL where requests are redirected after login when the
  1371. ``contrib.auth.login`` view gets no ``next`` parameter.
  1372. This is used by the :func:`~django.contrib.auth.decorators.login_required`
  1373. decorator, for example.
  1374. .. versionchanged:: 1.5
  1375. This setting now also accepts view function names and
  1376. :ref:`named URL patterns <naming-url-patterns>` which can be used to reduce
  1377. configuration duplication since you no longer have to define the URL in two
  1378. places (``settings`` and URLconf).
  1379. For backward compatibility reasons the default remains unchanged.
  1380. .. setting:: LOGIN_URL
  1381. LOGIN_URL
  1382. ---------
  1383. Default: ``'/accounts/login/'``
  1384. The URL where requests are redirected for login, especially when using the
  1385. :func:`~django.contrib.auth.decorators.login_required` decorator.
  1386. .. versionchanged:: 1.5
  1387. This setting now also accepts view function names and
  1388. :ref:`named URL patterns <naming-url-patterns>` which can be used to reduce
  1389. configuration duplication since you no longer have to define the URL in two
  1390. places (``settings`` and URLconf).
  1391. For backward compatibility reasons the default remains unchanged.
  1392. .. setting:: LOGOUT_URL
  1393. LOGOUT_URL
  1394. ----------
  1395. Default: ``'/accounts/logout/'``
  1396. LOGIN_URL counterpart.
  1397. .. setting:: PASSWORD_RESET_TIMEOUT_DAYS
  1398. PASSWORD_RESET_TIMEOUT_DAYS
  1399. ---------------------------
  1400. Default: ``3``
  1401. The number of days a password reset link is valid for. Used by the
  1402. :mod:`django.contrib.auth` password reset mechanism.
  1403. .. setting:: PASSWORD_HASHERS
  1404. PASSWORD_HASHERS
  1405. ----------------
  1406. See :ref:`auth_password_storage`.
  1407. Default::
  1408. ('django.contrib.auth.hashers.PBKDF2PasswordHasher',
  1409. 'django.contrib.auth.hashers.PBKDF2SHA1PasswordHasher',
  1410. 'django.contrib.auth.hashers.BCryptPasswordHasher',
  1411. 'django.contrib.auth.hashers.SHA1PasswordHasher',
  1412. 'django.contrib.auth.hashers.MD5PasswordHasher',
  1413. 'django.contrib.auth.hashers.UnsaltedMD5PasswordHasher',
  1414. 'django.contrib.auth.hashers.CryptPasswordHasher',)
  1415. .. _settings-comments:
  1416. Comments
  1417. ========
  1418. Settings for :mod:`django.contrib.comments`.
  1419. .. setting:: COMMENTS_HIDE_REMOVED
  1420. COMMENTS_HIDE_REMOVED
  1421. ---------------------
  1422. If ``True`` (default), removed comments will be excluded from comment
  1423. lists/counts (as taken from template tags). Otherwise, the template author is
  1424. responsible for some sort of a "this comment has been removed by the site staff"
  1425. message.
  1426. .. setting:: COMMENT_MAX_LENGTH
  1427. COMMENT_MAX_LENGTH
  1428. ------------------
  1429. The maximum length of the comment field, in characters. Comments longer than
  1430. this will be rejected. Defaults to 3000.
  1431. .. setting:: COMMENTS_APP
  1432. COMMENTS_APP
  1433. ------------
  1434. An app which provides :doc:`customization of the comments framework
  1435. </ref/contrib/comments/custom>`. Use the same dotted-string notation
  1436. as in :setting:`INSTALLED_APPS`. Your custom :setting:`COMMENTS_APP`
  1437. must also be listed in :setting:`INSTALLED_APPS`.
  1438. .. setting:: PROFANITIES_LIST
  1439. PROFANITIES_LIST
  1440. ----------------
  1441. Default: ``()`` (Empty tuple)
  1442. A tuple of profanities, as strings, that will be forbidden in comments when
  1443. ``COMMENTS_ALLOW_PROFANITIES`` is ``False``.
  1444. .. _settings-messages:
  1445. Messages
  1446. ========
  1447. Settings for :mod:`django.contrib.messages`.
  1448. .. setting:: MESSAGE_LEVEL
  1449. MESSAGE_LEVEL
  1450. -------------
  1451. Default: ``messages.INFO``
  1452. Sets the minimum message level that will be recorded by the messages
  1453. framework. See :ref:`message levels <message-level>` for more details.
  1454. .. admonition:: Important
  1455. If you override ``MESSAGE_LEVEL`` in your settings file and rely on any of
  1456. the built-in constants, you must import the constants module directly to
  1457. avoid the potential for circular imports, e.g.::
  1458. from django.contrib.messages import constants as message_constants
  1459. MESSAGE_LEVEL = message_constants.DEBUG
  1460. If desired, you may specify the numeric values for the constants directly
  1461. according to the values in the above :ref:`constants table
  1462. <message-level-constants>`.
  1463. .. setting:: MESSAGE_STORAGE
  1464. MESSAGE_STORAGE
  1465. ---------------
  1466. Default: ``'django.contrib.messages.storage.fallback.FallbackStorage'``
  1467. Controls where Django stores message data. Valid values are:
  1468. * ``'django.contrib.messages.storage.fallback.FallbackStorage'``
  1469. * ``'django.contrib.messages.storage.session.SessionStorage'``
  1470. * ``'django.contrib.messages.storage.cookie.CookieStorage'``
  1471. See :ref:`message storage backends <message-storage-backends>` for more details.
  1472. The backends that use cookies -- ``CookieStorage`` and ``FallbackStorage`` --
  1473. use the value of :setting:`SESSION_COOKIE_DOMAIN` when setting their cookies.
  1474. .. setting:: MESSAGE_TAGS
  1475. MESSAGE_TAGS
  1476. ------------
  1477. Default::
  1478. {messages.DEBUG: 'debug',
  1479. messages.INFO: 'info',
  1480. messages.SUCCESS: 'success',
  1481. messages.WARNING: 'warning',
  1482. messages.ERROR: 'error',}
  1483. This sets the mapping of message level to message tag, which is typically
  1484. rendered as a CSS class in HTML. If you specify a value, it will extend
  1485. the default. This means you only have to specify those values which you need
  1486. to override. See :ref:`message-displaying` above for more details.
  1487. .. admonition:: Important
  1488. If you override ``MESSAGE_TAGS`` in your settings file and rely on any of
  1489. the built-in constants, you must import the ``constants`` module directly to
  1490. avoid the potential for circular imports, e.g.::
  1491. from django.contrib.messages import constants as message_constants
  1492. MESSAGE_TAGS = {message_constants.INFO: ''}
  1493. If desired, you may specify the numeric values for the constants directly
  1494. according to the values in the above :ref:`constants table
  1495. <message-level-constants>`.
  1496. .. _settings-sessions:
  1497. Sessions
  1498. ========
  1499. Settings for :mod:`django.contrib.sessions`.
  1500. .. setting:: SESSION_CACHE_ALIAS
  1501. SESSION_CACHE_ALIAS
  1502. -------------------
  1503. Default: ``default``
  1504. If you're using :ref:`cache-based session storage <cached-sessions-backend>`,
  1505. this selects the cache to use.
  1506. .. setting:: SESSION_COOKIE_AGE
  1507. SESSION_COOKIE_AGE
  1508. ------------------
  1509. Default: ``1209600`` (2 weeks, in seconds)
  1510. The age of session cookies, in seconds.
  1511. .. setting:: SESSION_COOKIE_DOMAIN
  1512. SESSION_COOKIE_DOMAIN
  1513. ---------------------
  1514. Default: ``None``
  1515. The domain to use for session cookies. Set this to a string such as
  1516. ``".example.com"`` (note the leading dot!) for cross-domain cookies, or use
  1517. ``None`` for a standard domain cookie.
  1518. Be cautious when updating this setting on a production site. If you update
  1519. this setting to enable cross-domain cookies on a site that previously used
  1520. standard domain cookies, existing user cookies will be set to the old
  1521. domain. This may result in them being unable to log in as long as these cookies
  1522. persist.
  1523. .. setting:: SESSION_COOKIE_HTTPONLY
  1524. SESSION_COOKIE_HTTPONLY
  1525. -----------------------
  1526. Default: ``True``
  1527. Whether to use ``HTTPOnly`` flag on the session cookie. If this is set to
  1528. ``True``, client-side JavaScript will not to be able to access the
  1529. session cookie.
  1530. HTTPOnly_ is a flag included in a Set-Cookie HTTP response header. It
  1531. is not part of the :rfc:`2109` standard for cookies, and it isn't honored
  1532. consistently by all browsers. However, when it is honored, it can be a
  1533. useful way to mitigate the risk of client side script accessing the
  1534. protected cookie data.
  1535. .. _HTTPOnly: https://www.owasp.org/index.php/HTTPOnly
  1536. .. setting:: SESSION_COOKIE_NAME
  1537. SESSION_COOKIE_NAME
  1538. -------------------
  1539. Default: ``'sessionid'``
  1540. The name of the cookie to use for sessions. This can be whatever you want (but
  1541. should be different from :setting:`LANGUAGE_COOKIE_NAME`).
  1542. .. setting:: SESSION_COOKIE_PATH
  1543. SESSION_COOKIE_PATH
  1544. -------------------
  1545. Default: ``'/'``
  1546. The path set on the session cookie. This should either match the URL path of your
  1547. Django installation or be parent of that path.
  1548. This is useful if you have multiple Django instances running under the same
  1549. hostname. They can use different cookie paths, and each instance will only see
  1550. its own session cookie.
  1551. .. setting:: SESSION_COOKIE_SECURE
  1552. SESSION_COOKIE_SECURE
  1553. ---------------------
  1554. Default: ``False``
  1555. Whether to use a secure cookie for the session cookie. If this is set to
  1556. ``True``, the cookie will be marked as "secure," which means browsers may
  1557. ensure that the cookie is only sent under an HTTPS connection.
  1558. .. setting:: SESSION_ENGINE
  1559. SESSION_ENGINE
  1560. --------------
  1561. Default: ``django.contrib.sessions.backends.db``
  1562. Controls where Django stores session data. Valid values are:
  1563. * ``'django.contrib.sessions.backends.db'``
  1564. * ``'django.contrib.sessions.backends.file'``
  1565. * ``'django.contrib.sessions.backends.cache'``
  1566. * ``'django.contrib.sessions.backends.cached_db'``
  1567. * ``'django.contrib.sessions.backends.signed_cookies'``
  1568. See :ref:`configuring-sessions` for more details.
  1569. .. setting:: SESSION_EXPIRE_AT_BROWSER_CLOSE
  1570. SESSION_EXPIRE_AT_BROWSER_CLOSE
  1571. -------------------------------
  1572. Default: ``False``
  1573. Whether to expire the session when the user closes his or her browser. See
  1574. :ref:`browser-length-vs-persistent-sessions`.
  1575. .. setting:: SESSION_FILE_PATH
  1576. SESSION_FILE_PATH
  1577. -----------------
  1578. Default: ``None``
  1579. If you're using file-based session storage, this sets the directory in
  1580. which Django will store session data. When the default value (``None``) is
  1581. used, Django will use the standard temporary directory for the system.
  1582. .. setting:: SESSION_SAVE_EVERY_REQUEST
  1583. SESSION_SAVE_EVERY_REQUEST
  1584. --------------------------
  1585. Default: ``False``
  1586. Whether to save the session data on every request. If this is ``False``
  1587. (default), then the session data will only be saved if it has been modified --
  1588. that is, if any of its dictionary values have been assigned or deleted.
  1589. Sites
  1590. =====
  1591. Settings for :mod:`django.contrib.sites`.
  1592. .. setting:: SITE_ID
  1593. SITE_ID
  1594. -------
  1595. Default: Not defined
  1596. The ID, as an integer, of the current site in the ``django_site`` database
  1597. table. This is used so that application data can hook into specific sites
  1598. and a single database can manage content for multiple sites.
  1599. .. _settings-staticfiles:
  1600. Static files
  1601. ============
  1602. Settings for :mod:`django.contrib.staticfiles`.
  1603. .. setting:: STATIC_ROOT
  1604. STATIC_ROOT
  1605. -----------
  1606. Default: ``''`` (Empty string)
  1607. The absolute path to the directory where :djadmin:`collectstatic` will collect
  1608. static files for deployment.
  1609. Example: ``"/var/www/example.com/static/"``
  1610. If the :doc:`staticfiles</ref/contrib/staticfiles>` contrib app is enabled
  1611. (default) the :djadmin:`collectstatic` management command will collect static
  1612. files into this directory. See the howto on :doc:`managing static
  1613. files</howto/static-files/index>` for more details about usage.
  1614. .. warning::
  1615. This should be an (initially empty) destination directory for collecting
  1616. your static files from their permanent locations into one directory for
  1617. ease of deployment; it is **not** a place to store your static files
  1618. permanently. You should do that in directories that will be found by
  1619. :doc:`staticfiles</ref/contrib/staticfiles>`'s
  1620. :setting:`finders<STATICFILES_FINDERS>`, which by default, are
  1621. ``'static/'`` app sub-directories and any directories you include in
  1622. :setting:`STATICFILES_DIRS`).
  1623. .. setting:: STATIC_URL
  1624. STATIC_URL
  1625. ----------
  1626. Default: ``None``
  1627. URL to use when referring to static files located in :setting:`STATIC_ROOT`.
  1628. Example: ``"/static/"`` or ``"http://static.example.com/"``
  1629. If not ``None``, this will be used as the base path for
  1630. :ref:`asset definitions<form-asset-paths>` (the ``Media`` class) and the
  1631. :doc:`staticfiles app</ref/contrib/staticfiles>`.
  1632. It must end in a slash if set to a non-empty value.
  1633. .. setting:: STATICFILES_DIRS
  1634. STATICFILES_DIRS
  1635. ----------------
  1636. Default: ``[]``
  1637. This setting defines the additional locations the staticfiles app will traverse
  1638. if the ``FileSystemFinder`` finder is enabled, e.g. if you use the
  1639. :djadmin:`collectstatic` or :djadmin:`findstatic` management command or use the
  1640. static file serving view.
  1641. This should be set to a list or tuple of strings that contain full paths to
  1642. your additional files directory(ies) e.g.::
  1643. STATICFILES_DIRS = (
  1644. "/home/special.polls.com/polls/static",
  1645. "/home/polls.com/polls/static",
  1646. "/opt/webfiles/common",
  1647. )
  1648. Prefixes (optional)
  1649. ~~~~~~~~~~~~~~~~~~~
  1650. In case you want to refer to files in one of the locations with an additional
  1651. namespace, you can **optionally** provide a prefix as ``(prefix, path)``
  1652. tuples, e.g.::
  1653. STATICFILES_DIRS = (
  1654. # ...
  1655. ("downloads", "/opt/webfiles/stats"),
  1656. )
  1657. Example:
  1658. Assuming you have :setting:`STATIC_URL` set ``'/static/'``, the
  1659. :djadmin:`collectstatic` management command would collect the "stats" files
  1660. in a ``'downloads'`` subdirectory of :setting:`STATIC_ROOT`.
  1661. This would allow you to refer to the local file
  1662. ``'/opt/webfiles/stats/polls_20101022.tar.gz'`` with
  1663. ``'/static/downloads/polls_20101022.tar.gz'`` in your templates, e.g.:
  1664. .. code-block:: html+django
  1665. <a href="{{ STATIC_URL }}downloads/polls_20101022.tar.gz">
  1666. .. setting:: STATICFILES_STORAGE
  1667. STATICFILES_STORAGE
  1668. -------------------
  1669. Default: ``'django.contrib.staticfiles.storage.StaticFilesStorage'``
  1670. The file storage engine to use when collecting static files with the
  1671. :djadmin:`collectstatic` management command.
  1672. A ready-to-use instance of the storage backend defined in this setting
  1673. can be found at ``django.contrib.staticfiles.storage.staticfiles_storage``.
  1674. For an example, see :ref:`staticfiles-from-cdn`.
  1675. .. setting:: STATICFILES_FINDERS
  1676. STATICFILES_FINDERS
  1677. -------------------
  1678. Default::
  1679. ("django.contrib.staticfiles.finders.FileSystemFinder",
  1680. "django.contrib.staticfiles.finders.AppDirectoriesFinder")
  1681. The list of finder backends that know how to find static files in
  1682. various locations.
  1683. The default will find files stored in the :setting:`STATICFILES_DIRS` setting
  1684. (using ``django.contrib.staticfiles.finders.FileSystemFinder``) and in a
  1685. ``static`` subdirectory of each app (using
  1686. ``django.contrib.staticfiles.finders.AppDirectoriesFinder``). If multiple
  1687. files with the same name are present, the first file that is found will be
  1688. used.
  1689. One finder is disabled by default:
  1690. ``django.contrib.staticfiles.finders.DefaultStorageFinder``. If added to
  1691. your :setting:`STATICFILES_FINDERS` setting, it will look for static files in
  1692. the default file storage as defined by the :setting:`DEFAULT_FILE_STORAGE`
  1693. setting.
  1694. .. note::
  1695. When using the ``AppDirectoriesFinder`` finder, make sure your apps
  1696. can be found by staticfiles. Simply add the app to the
  1697. :setting:`INSTALLED_APPS` setting of your site.
  1698. Static file finders are currently considered a private interface, and this
  1699. interface is thus undocumented.
  1700. Core Settings Topical Index
  1701. ===========================
  1702. Cache
  1703. -----
  1704. * :setting:`CACHES`
  1705. * :setting:`CACHE_MIDDLEWARE_ALIAS`
  1706. * :setting:`CACHE_MIDDLEWARE_ANONYMOUS_ONLY`
  1707. * :setting:`CACHE_MIDDLEWARE_KEY_PREFIX`
  1708. * :setting:`CACHE_MIDDLEWARE_SECONDS`
  1709. Database
  1710. --------
  1711. * :setting:`DATABASES`
  1712. * :setting:`DATABASE_ROUTERS`
  1713. * :setting:`DEFAULT_INDEX_TABLESPACE`
  1714. * :setting:`DEFAULT_TABLESPACE`
  1715. * :setting:`TRANSACTIONS_MANAGED`
  1716. Debugging
  1717. ---------
  1718. * :setting:`DEBUG`
  1719. * :setting:`DEBUG_PROPAGATE_EXCEPTIONS`
  1720. Email
  1721. -----
  1722. * :setting:`ADMINS`
  1723. * :setting:`DEFAULT_CHARSET`
  1724. * :setting:`DEFAULT_FROM_EMAIL`
  1725. * :setting:`EMAIL_BACKEND`
  1726. * :setting:`EMAIL_FILE_PATH`
  1727. * :setting:`EMAIL_HOST`
  1728. * :setting:`EMAIL_HOST_PASSWORD`
  1729. * :setting:`EMAIL_HOST_USER`
  1730. * :setting:`EMAIL_PORT`
  1731. * :setting:`EMAIL_SUBJECT_PREFIX`
  1732. * :setting:`EMAIL_USE_TLS`
  1733. * :setting:`MANAGERS`
  1734. * :setting:`SEND_BROKEN_LINK_EMAILS`
  1735. * :setting:`SERVER_EMAIL`
  1736. Error reporting
  1737. ---------------
  1738. * :setting:`DEFAULT_EXCEPTION_REPORTER_FILTER`
  1739. * :setting:`IGNORABLE_404_URLS`
  1740. * :setting:`MANAGERS`
  1741. * :setting:`SEND_BROKEN_LINK_EMAILS`
  1742. File uploads
  1743. ------------
  1744. * :setting:`DEFAULT_FILE_STORAGE`
  1745. * :setting:`FILE_CHARSET`
  1746. * :setting:`FILE_UPLOAD_HANDLERS`
  1747. * :setting:`FILE_UPLOAD_MAX_MEMORY_SIZE`
  1748. * :setting:`FILE_UPLOAD_PERMISSIONS`
  1749. * :setting:`FILE_UPLOAD_TEMP_DIR`
  1750. * :setting:`MEDIA_ROOT`
  1751. * :setting:`MEDIA_URL`
  1752. Globalization (i18n/l10n)
  1753. -------------------------
  1754. * :setting:`DATE_FORMAT`
  1755. * :setting:`DATE_INPUT_FORMATS`
  1756. * :setting:`DATETIME_FORMAT`
  1757. * :setting:`DATETIME_INPUT_FORMATS`
  1758. * :setting:`DECIMAL_SEPARATOR`
  1759. * :setting:`FIRST_DAY_OF_WEEK`
  1760. * :setting:`FORMAT_MODULE_PATH`
  1761. * :setting:`LANGUAGE_CODE`
  1762. * :setting:`LANGUAGE_COOKIE_NAME`
  1763. * :setting:`LANGUAGES`
  1764. * :setting:`LOCALE_PATHS`
  1765. * :setting:`MONTH_DAY_FORMAT`
  1766. * :setting:`NUMBER_GROUPING`
  1767. * :setting:`SHORT_DATE_FORMAT`
  1768. * :setting:`SHORT_DATETIME_FORMAT`
  1769. * :setting:`THOUSAND_SEPARATOR`
  1770. * :setting:`TIME_FORMAT`
  1771. * :setting:`TIME_INPUT_FORMATS`
  1772. * :setting:`TIME_ZONE`
  1773. * :setting:`USE_I18N`
  1774. * :setting:`USE_L10N`
  1775. * :setting:`USE_THOUSAND_SEPARATOR`
  1776. * :setting:`USE_TZ`
  1777. * :setting:`YEAR_MONTH_FORMAT`
  1778. HTTP
  1779. ----
  1780. * :setting:`DEFAULT_CHARSET`
  1781. * :setting:`DEFAULT_CONTENT_TYPE`
  1782. * :setting:`DISALLOWED_USER_AGENTS`
  1783. * :setting:`FORCE_SCRIPT_NAME`
  1784. * :setting:`INTERNAL_IPS`
  1785. * :setting:`MIDDLEWARE_CLASSES`
  1786. * :setting:`SECURE_PROXY_SSL_HEADER`
  1787. * :setting:`SIGNING_BACKEND`
  1788. * :setting:`USE_ETAGS`
  1789. * :setting:`USE_X_FORWARDED_HOST`
  1790. * :setting:`WSGI_APPLICATION`
  1791. Logging
  1792. -------
  1793. * :setting:`LOGGING`
  1794. * :setting:`LOGGING_CONFIG`
  1795. Models
  1796. ------
  1797. * :setting:`ABSOLUTE_URL_OVERRIDES`
  1798. * :setting:`FIXTURE_DIRS`
  1799. * :setting:`INSTALLED_APPS`
  1800. Security
  1801. --------
  1802. * Cross Site Request Forgery protection
  1803. * :setting:`CSRF_COOKIE_DOMAIN`
  1804. * :setting:`CSRF_COOKIE_NAME`
  1805. * :setting:`CSRF_COOKIE_PATH`
  1806. * :setting:`CSRF_COOKIE_SECURE`
  1807. * :setting:`CSRF_FAILURE_VIEW`
  1808. * :setting:`SECRET_KEY`
  1809. * :setting:`X_FRAME_OPTIONS`
  1810. Serialization
  1811. -------------
  1812. * :setting:`DEFAULT_CHARSET`
  1813. * :setting:`SERIALIZATION_MODULES`
  1814. Templates
  1815. ---------
  1816. * :setting:`ALLOWED_INCLUDE_ROOTS`
  1817. * :setting:`TEMPLATE_CONTEXT_PROCESSORS`
  1818. * :setting:`TEMPLATE_DEBUG`
  1819. * :setting:`TEMPLATE_DIRS`
  1820. * :setting:`TEMPLATE_LOADERS`
  1821. * :setting:`TEMPLATE_STRING_IF_INVALID`
  1822. Testing
  1823. -------
  1824. * Database
  1825. * :setting:`TEST_CHARSET`
  1826. * :setting:`TEST_COLLATION`
  1827. * :setting:`TEST_DEPENDENCIES`
  1828. * :setting:`TEST_MIRROR`
  1829. * :setting:`TEST_NAME`
  1830. * :setting:`TEST_CREATE`
  1831. * :setting:`TEST_USER`
  1832. * :setting:`TEST_USER_CREATE`
  1833. * :setting:`TEST_PASSWD`
  1834. * :setting:`TEST_TBLSPACE`
  1835. * :setting:`TEST_TBLSPACE_TMP`
  1836. * :setting:`TEST_RUNNER`
  1837. URLs
  1838. ----
  1839. * :setting:`APPEND_SLASH`
  1840. * :setting:`PREPEND_WWW`
  1841. * :setting:`ROOT_URLCONF`