PageRenderTime 138ms CodeModel.GetById 29ms app.highlight 13ms RepoModel.GetById 1ms app.codeStats 80ms

/docs/ref/settings.txt

https://code.google.com/p/mango-py/
Plain Text | 2103 lines | 1361 code | 742 blank | 0 comment | 0 complexity | c4a32d0c13168495a8fca0f9cd93620b MD5 | raw file

Large files files are truncated, but you can click here to view the full file

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

Large files files are truncated, but you can click here to view the full file