Ticket #15992: 15992.patch

File 15992.patch, 60.7 KB (added by Aymeric Augustin, 14 years ago)
  • docs/internals/contributing.txt

     
    10041004
    10051005You will also need to ensure that your database uses UTF-8 as the default
    10061006character set. If your database server doesn't use UTF-8 as a default charset,
    1007 you will need to include a value for ``TEST_CHARSET`` in the settings
     1007you will need to include a value for :setting:`TEST_CHARSET` in the settings
    10081008dictionary for the applicable database.
    10091009
    10101010Running only some of the tests
  • docs/internals/documentation.txt

     
    3434The main thing to keep in mind as you write and edit docs is that the more
    3535semantic markup you can add the better. So::
    3636
    37     Add ``django.contrib.auth`` to your ``INSTALLED_APPS``...
     37    Add ``django.contrib.auth`` to your :setting:`INSTALLED_APPS`...
    3838
    3939Isn't nearly as helpful as::
    4040
  • docs/internals/deprecation.txt

     
    170170          and :class:`django.contrib.auth.context_processors.PermLookupDict`,
    171171          respectively.
    172172
    173         * The ``MEDIA_URL`` or ``STATIC_URL`` settings are required to end
    174           with a trailing slash to ensure there is a consistent way to
    175           combine paths in templates.
     173        * The :setting:`MEDIA_URL` or :setting:`STATIC_URL` settings are
     174          required to end with a trailing slash to ensure there is a consistent
     175          way to combine paths in templates.
    176176
    177177    * 1.6
    178178        * The compatibility modules ``django.utils.copycompat`` and
  • docs/howto/i18n.txt

     
    5555
    5656All message file repositories are structured the same way. They are:
    5757
    58     * All paths listed in ``LOCALE_PATHS`` in your settings file are
     58    * All paths listed in :setting:`LOCALE_PATHS` in your settings file are
    5959      searched for ``<language>/LC_MESSAGES/django.(po|mo)``
    6060    * ``$PROJECTPATH/locale/<language>/LC_MESSAGES/django.(po|mo)`` --
    6161      deprecated, see above.
  • docs/topics/i18n/internationalization.txt

     
    547547
    548548Each ``RequestContext`` has access to three translation-specific variables:
    549549
    550     * ``LANGUAGES`` is a list of tuples in which the first element is the
     550    * :setting:`LANGUAGES` is a list of tuples in which the first element is the
    551551      :term:`language code` and the second is the language name (translated into
    552552      the currently active locale).
    553553
    554     * ``LANGUAGE_CODE`` is the current user's preferred language, as a string.
     554    * :setting:`LANGUAGE_CODE` is the current user's preferred language, as a string.
    555555      Example: ``en-us``. (See :ref:`how-django-discovers-language-preference`.)
    556556
    557557    * ``LANGUAGE_BIDI`` is the current locale's direction. If True, it's a
     
    675675    )
    676676
    677677Each string in ``packages`` should be in Python dotted-package syntax (the
    678 same format as the strings in ``INSTALLED_APPS``) and should refer to a package
     678same format as the strings in :setting:`INSTALLED_APPS`) and should refer to a package
    679679that contains a ``locale`` directory. If you specify multiple packages, all
    680680those catalogs are merged into one catalog. This is useful if you have
    681681JavaScript that uses strings from different applications.
     
    708708later.
    709709
    710710.. versionchanged:: 1.3
    711     Directories listed in ``LOCALE_PATHS`` weren't included in the lookup
     711    Directories listed in :setting:`LOCALE_PATHS` weren't included in the lookup
    712712    algorithm until version 1.3.
    713713
    714714Using the JavaScript translation catalog
  • docs/topics/i18n/index.txt

     
    104104variant on the provided English value. The format is identical to the format
    105105strings used by the ``now`` template tag.
    106106
    107 For example, with ``DATETIME_FORMAT`` (or ``DATE_FORMAT`` or ``TIME_FORMAT``),
     107For example, with :setting:`DATETIME_FORMAT` (or :setting:`DATE_FORMAT` or :setting:`TIME_FORMAT`),
    108108this would be the format string that you want to use in your language. A Django
    109109contributor localizing it to Spanish probably would provide a ``"j N Y P"``
    110110"translation" for it in the relevant ``django.po`` file::
  • docs/topics/i18n/deployment.txt

     
    1313optimizations so as not to load the internationalization machinery.
    1414
    1515You'll probably also want to remove ``'django.core.context_processors.i18n'``
    16 from your ``TEMPLATE_CONTEXT_PROCESSORS`` setting.
     16from your :setting:`TEMPLATE_CONTEXT_PROCESSORS` setting.
    1717
    1818.. note::
    1919
     
    4747other translator finds a translation.
    4848
    4949If all you want to do is run Django with your native language, and a language
    50 file is available for it, all you need to do is set ``LANGUAGE_CODE``.
     50file is available for it, all you need to do is set :setting:`LANGUAGE_CODE`.
    5151
    5252If you want to let each individual user specify which language he or she
    5353prefers, use ``LocaleMiddleware``. ``LocaleMiddleware`` enables language
    5454selection based on data from the request. It customizes content for each user.
    5555
    5656To use ``LocaleMiddleware``, add ``'django.middleware.locale.LocaleMiddleware'``
    57 to your ``MIDDLEWARE_CLASSES`` setting. Because middleware order matters, you
     57to your :setting:`MIDDLEWARE_CLASSES` setting. Because middleware order matters, you
    5858should follow these guidelines:
    5959
    6060    * Make sure it's one of the first middlewares installed.
     
    6262      makes use of session data.
    6363    * If you use ``CacheMiddleware``, put ``LocaleMiddleware`` after it.
    6464
    65 For example, your ``MIDDLEWARE_CLASSES`` might look like this::
     65For example, your :setting:`MIDDLEWARE_CLASSES` might look like this::
    6666
    6767    MIDDLEWARE_CLASSES = (
    6868       'django.contrib.sessions.middleware.SessionMiddleware',
     
    8181
    8282    * Failing that, it looks for a cookie.
    8383
    84       The name of the cookie used is set by the ``LANGUAGE_COOKIE_NAME``
     84      The name of the cookie used is set by the :setting:`LANGUAGE_COOKIE_NAME`
    8585      setting. (The default name is ``django_language``.)
    8686
    8787    * Failing that, it looks at the ``Accept-Language`` HTTP header. This
     
    8989      prefer, in order by priority. Django tries each language in the header
    9090      until it finds one with available translations.
    9191
    92     * Failing that, it uses the global ``LANGUAGE_CODE`` setting.
     92    * Failing that, it uses the global :setting:`LANGUAGE_CODE` setting.
    9393
    9494.. _locale-middleware-notes:
    9595
     
    107107    * Only languages listed in the :setting:`LANGUAGES` setting can be selected.
    108108      If you want to restrict the language selection to a subset of provided
    109109      languages (because your application doesn't provide all those languages),
    110       set ``LANGUAGES`` to a list of languages. For example::
     110      set :setting:`LANGUAGES` to a list of languages. For example::
    111111
    112112          LANGUAGES = (
    113113            ('de', _('German')),
     
    118118      selection to German and English (and any sublanguage, like de-ch or
    119119      en-us).
    120120
    121     * If you define a custom ``LANGUAGES`` setting, as explained in the
     121    * If you define a custom :setting:`LANGUAGES` setting, as explained in the
    122122      previous bullet, it's OK to mark the languages as translation strings
    123123      -- but use a "dummy" ``ugettext()`` function, not the one in
    124124      ``django.utils.translation``. You should *never* import
     
    139139      With this arrangement, ``django-admin.py makemessages`` will still find
    140140      and mark these strings for translation, but the translation won't happen
    141141      at runtime -- so you'll have to remember to wrap the languages in the
    142       *real* ``ugettext()`` in any code that uses ``LANGUAGES`` at runtime.
     142      *real* ``ugettext()`` in any code that uses :setting:`LANGUAGES` at runtime.
    143143
    144144    * The ``LocaleMiddleware`` can only select languages for which there is a
    145145      Django-provided base translation. If you want to provide translations
  • docs/topics/http/file-uploads.txt

     
    225225
    226226When a user uploads a file, Django passes off the file data to an *upload
    227227handler* -- a small class that handles file data as it gets uploaded. Upload
    228 handlers are initially defined in the ``FILE_UPLOAD_HANDLERS`` setting, which
     228handlers are initially defined in the :setting:`FILE_UPLOAD_HANDLERS` setting, which
    229229defaults to::
    230230
    231231    ("django.core.files.uploadhandler.MemoryFileUploadHandler",
     
    246246Sometimes particular views require different upload behavior. In these cases,
    247247you can override upload handlers on a per-request basis by modifying
    248248``request.upload_handlers``. By default, this list will contain the upload
    249 handlers given by ``FILE_UPLOAD_HANDLERS``, but you can modify the list as you
     249handlers given by :setting:`FILE_UPLOAD_HANDLERS`, but you can modify the list as you
    250250would any other list.
    251251
    252252For instance, suppose you've written a ``ProgressBarUploadHandler`` that
  • docs/topics/http/sessions.txt

     
    1717
    1818To enable session functionality, do the following:
    1919
    20     * Edit the ``MIDDLEWARE_CLASSES`` setting and make sure
    21       ``MIDDLEWARE_CLASSES`` contains ``'django.contrib.sessions.middleware.SessionMiddleware'``.
     20    * Edit the :setting:`MIDDLEWARE_CLASSES` setting and make sure
     21      :setting:`MIDDLEWARE_CLASSES` contains ``'django.contrib.sessions.middleware.SessionMiddleware'``.
    2222      The default ``settings.py`` created by ``django-admin.py startproject`` has
    2323      ``SessionMiddleware`` activated.
    2424
    2525If you don't want to use sessions, you might as well remove the
    26 ``SessionMiddleware`` line from ``MIDDLEWARE_CLASSES`` and ``'django.contrib.sessions'``
    27 from your ``INSTALLED_APPS``. It'll save you a small bit of overhead.
     26``SessionMiddleware`` line from :setting:`MIDDLEWARE_CLASSES` and ``'django.contrib.sessions'``
     27from your :setting:`INSTALLED_APPS`. It'll save you a small bit of overhead.
    2828
    2929Configuring the session engine
    3030==============================
     
    3838------------------------------
    3939
    4040If you want to use a database-backed session, you need to add
    41 ``'django.contrib.sessions'`` to your ``INSTALLED_APPS`` setting.
     41``'django.contrib.sessions'`` to your :setting:`INSTALLED_APPS` setting.
    4242
    4343Once you have configured your installation, run ``manage.py syncdb``
    4444to install the single database table that stores session data.
     
    8686Using file-based sessions
    8787-------------------------
    8888
    89 To use file-based sessions, set the ``SESSION_ENGINE`` setting to
     89To use file-based sessions, set the :setting:`SESSION_ENGINE` setting to
    9090``"django.contrib.sessions.backends.file"``.
    9191
    92 You might also want to set the ``SESSION_FILE_PATH`` setting (which defaults
     92You might also want to set the :setting:`SESSION_FILE_PATH` setting (which defaults
    9393to output from ``tempfile.gettempdir()``, most likely ``/tmp``) to control
    9494where Django stores session files. Be sure to check that your Web server has
    9595permissions to read and write to this location.
     
    346346
    347347    request.session.modified = True
    348348
    349 To change this default behavior, set the ``SESSION_SAVE_EVERY_REQUEST`` setting
    350 to ``True``. If ``SESSION_SAVE_EVERY_REQUEST`` is ``True``, Django will save
     349To change this default behavior, set the :setting:`SESSION_SAVE_EVERY_REQUEST` setting
     350to ``True``. If :setting:`SESSION_SAVE_EVERY_REQUEST` is ``True``, Django will save
    351351the session to the database on every single request.
    352352
    353353Note that the session cookie is only sent when a session has been created or
    354 modified. If ``SESSION_SAVE_EVERY_REQUEST`` is ``True``, the session cookie
     354modified. If :setting:`SESSION_SAVE_EVERY_REQUEST` is ``True``, the session cookie
    355355will be sent on every request.
    356356
    357357Similarly, the ``expires`` part of a session cookie is updated each time the
     
    361361===============================================
    362362
    363363You can control whether the session framework uses browser-length sessions vs.
    364 persistent sessions with the ``SESSION_EXPIRE_AT_BROWSER_CLOSE`` setting.
     364persistent sessions with the :setting:`SESSION_EXPIRE_AT_BROWSER_CLOSE` setting.
    365365
    366 By default, ``SESSION_EXPIRE_AT_BROWSER_CLOSE`` is set to ``False``, which
     366By default, :setting:`SESSION_EXPIRE_AT_BROWSER_CLOSE` is set to ``False``, which
    367367means session cookies will be stored in users' browsers for as long as
    368 ``SESSION_COOKIE_AGE``. Use this if you don't want people to have to log in
     368:setting:`SESSION_COOKIE_AGE`. Use this if you don't want people to have to log in
    369369every time they open a browser.
    370370
    371 If ``SESSION_EXPIRE_AT_BROWSER_CLOSE`` is set to ``True``, Django will use
     371If :setting:`SESSION_EXPIRE_AT_BROWSER_CLOSE` is set to ``True``, Django will use
    372372browser-length cookies -- cookies that expire as soon as the user closes his or
    373373her browser. Use this if you want people to have to log in every time they open
    374374a browser.
  • docs/topics/http/views.txt

     
    4848
    4949.. admonition:: Django's Time Zone
    5050   
    51     Django includes a ``TIME_ZONE`` setting that defaults to
     51    Django includes a :setting:`TIME_ZONE` setting that defaults to
    5252    ``America/Chicago``. This probably isn't where you live, so you might want
    5353    to change it in your settings file.
    5454
  • docs/topics/cache.txt

     
    420420entire site. You'll need to add
    421421``'django.middleware.cache.UpdateCacheMiddleware'`` and
    422422``'django.middleware.cache.FetchFromCacheMiddleware'`` to your
    423 ``MIDDLEWARE_CLASSES`` setting, as in this example::
     423:setting:`MIDDLEWARE_CLASSES` setting, as in this example::
    424424
    425425    MIDDLEWARE_CLASSES = (
    426426        'django.middleware.cache.UpdateCacheMiddleware',
  • docs/topics/testing.txt

     
    382382Aside from using a separate database, the test runner will otherwise
    383383use all of the same database settings you have in your settings file:
    384384:setting:`ENGINE`, :setting:`USER`, :setting:`HOST`, etc. The test
    385 database is created by the user specified by ``USER``, so you'll need
     385database is created by the user specified by :setting:`USER`, so you'll need
    386386to make sure that the given user account has sufficient privileges to
    387387create a new database on the system.
    388388
     
    12991299``django.test.TestCase`` provides the ability to customize the URLconf
    13001300configuration for the duration of the execution of a test suite. If your
    13011301``TestCase`` instance defines an ``urls`` attribute, the ``TestCase`` will use
    1302 the value of that attribute as the ``ROOT_URLCONF`` for the duration of that
     1302the value of that attribute as the :setting:`ROOT_URLCONF` for the duration of that
    13031303test.
    13041304
    13051305For example::
  • docs/topics/logging.txt

     
    3939the severity of the messages that the logger will handle. Python
    4040defines the following log levels:
    4141
    42     * ``DEBUG``: Low level system information for debugging purposes
     42    * :setting:`DEBUG`: Low level system information for debugging purposes
    4343
    4444    * ``INFO``: General system information
    4545
     
    299299    * Defines two formatters:
    300300
    301301        * ``simple``, that just outputs the log level name (e.g.,
    302           ``DEBUG``) and the log message.
     302          :setting:`DEBUG`) and the log message.
    303303
    304304          The `format` string is a normal Python formatting string
    305305          describing the details that are to be output on each logging
     
    320320
    321321    * Defines three handlers:
    322322
    323         * ``null``, a NullHandler, which will pass any ``DEBUG`` or
     323        * ``null``, a NullHandler, which will pass any :setting:`DEBUG` or
    324324          higher message to ``/dev/null``.
    325325
    326         * ``console``, a StreamHandler, which will print any ``DEBUG``
     326        * ``console``, a StreamHandler, which will print any :setting:`DEBUG`
    327327          message to stdout. This handler uses the `simple` output
    328328          format.
    329329
     
    450450
    451451Messages relating to the interaction of code with the database.
    452452For example, every SQL statement executed by a request is logged
    453 at the ``DEBUG`` level to this logger.
     453at the :setting:`DEBUG` level to this logger.
    454454
    455455Messages to this logger have the following extra context:
    456456
     
    486486    The ``include_html`` argument of ``AdminEmailHandler`` is used to
    487487    control whether the traceback email includes an HTML attachment
    488488    containing the full content of the debug Web page that would have been
    489     produced if ``DEBUG`` were ``True``. To set this value in your
     489    produced if :setting:`DEBUG` were ``True``. To set this value in your
    490490    configuration, include it in the handler definition for
    491491    ``django.utils.log.AdminEmailHandler``, like this::
    492492
  • docs/topics/email.txt

     
    509509-------------------------------
    510510
    511511If you need to change how emails are sent you can write your own email
    512 backend. The ``EMAIL_BACKEND`` setting in your settings file is then the
     512backend. The :setting:`EMAIL_BACKEND` setting in your settings file is then the
    513513Python import path for your backend class.
    514514
    515515Custom email backends should subclass ``BaseEmailBackend`` that is located in
  • docs/topics/templates.txt

     
    101101``title`` attribute of the ``section`` object.
    102102
    103103If you use a variable that doesn't exist, the template system will insert
    104 the value of the ``TEMPLATE_STRING_IF_INVALID`` setting, which is set to ``''``
     104the value of the :setting:`TEMPLATE_STRING_IF_INVALID` setting, which is set to ``''``
    105105(the empty string) by default.
    106106
    107107Filters
  • docs/topics/settings.txt

     
    209209first positional argument) in the call to ``configure()``.
    210210
    211211In this example, default settings are taken from ``myapp_defaults``, and the
    212 ``DEBUG`` setting is set to ``True``, regardless of its value in
     212:setting:`DEBUG` setting is set to ``True``, regardless of its value in
    213213``myapp_defaults``::
    214214
    215215    from django.conf import settings
  • docs/releases/1.3.txt

     
    264264:ref:`running the Django test suite <running-unit-tests>` with ``runtests.py``
    265265when using :ref:`spatial database backends <spatial-backends>`.
    266266
    267 ``MEDIA_URL`` and ``STATIC_URL`` must end in a slash
     267:setting:`MEDIA_URL` and :setting:`STATIC_URL` must end in a slash
    268268~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    269269
    270270Previously, the :setting:`MEDIA_URL` setting only required a trailing slash if
     
    580580
    581581 * Now it is possible to override the translations shipped with applications by
    582582   using the :setting:`LOCALE_PATHS` setting whose translations have now higher
    583    precedence than the translations of ``INSTALLED_APPS`` applications.
     583   precedence than the translations of :setting:`INSTALLED_APPS` applications.
    584584   The relative priority among the values listed in this setting has also been
    585585   modified so the paths listed first have higher precedence than the
    586586   ones listed later.
     
    588588 * The ``locale`` subdirectory of the directory containing the settings, that
    589589   usually coincides with and is know as the *project directory* is being
    590590   deprecated in this release as a source of translations. (the precedence of
    591    these translations is intermediate between applications and ``LOCALE_PATHS``
     591   these translations is intermediate between applications and :setting:`LOCALE_PATHS`
    592592   translations). See the `corresponding deprecated features section`_
    593593   of this document.
    594594
  • docs/releases/1.0-porting-guide.txt

     
    443443Django fails to find the settings module and a :exc:`RuntimeError` when you try
    444444to reconfigure settings after having already used them
    445445
    446 ``LOGIN_URL`` has moved
     446:setting:`LOGIN_URL` has moved
    447447~~~~~~~~~~~~~~~~~~~~~~~
    448448
    449 The ``LOGIN_URL`` constant moved from ``django.contrib.auth`` into the
     449The :setting:`LOGIN_URL` constant moved from ``django.contrib.auth`` into the
    450450``settings`` module. Instead of using ``from django.contrib.auth import
    451451LOGIN_URL`` refer to :setting:`settings.LOGIN_URL <LOGIN_URL>`.
    452452
     
    454454~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    455455
    456456In 0.96, if a URL didn't end in a slash or have a period in the final
    457 component of its path, and ``APPEND_SLASH`` was True, Django would redirect
     457component of its path, and :setting:`APPEND_SLASH` was True, Django would redirect
    458458to the same URL, but with a slash appended to the end. Now, Django checks to
    459459see whether the pattern without the trailing slash would be matched by
    460460something in your URL patterns. If so, no redirection takes place, because it
     
    548548  **Back up your database first!**
    549549
    550550  For SQLite, this means making a copy of the single file that stores the
    551   database (the name of that file is the ``DATABASE_NAME`` in your settings.py
     551  database (the name of that file is the :setting:`DATABASE_NAME` in your settings.py
    552552  file).
    553553
    554554To upgrade each application to use a ``DecimalField``, you can do the
  • docs/releases/1.3-alpha-1.txt

     
    249249prohibited words an empty list.
    250250
    251251If you want to restore the old behavior, simply put a
    252 ``PROFANITIES_LIST`` setting in your settings file that includes the
     252:setting:`PROFANITIES_LIST` setting in your settings file that includes the
    253253words that you want to prohibit (see the `commit that implemented this
    254254change`_ if you want to see the list of words that was historically
    255255prohibited). However, if avoiding profanities is important to you, you
  • docs/releases/1.2.txt

     
    10761076to provide localizers the possibility to translate date and time formats. They
    10771077were translatable :term:`translation strings <translation string>` that could
    10781078be recognized because they were all upper case (for example
    1079 ``DATETIME_FORMAT``, ``DATE_FORMAT``, ``TIME_FORMAT``). They have been
     1079:setting:`DATETIME_FORMAT`, :setting:`DATE_FORMAT`, :setting:`TIME_FORMAT`). They have been
    10801080deprecated in favor of the new :ref:`Format localization
    10811081<format-localization>` infrastructure that allows localizers to specify that
    10821082information in a ``formats.py`` file in the corresponding
  • docs/faq/models.txt

     
    66How can I see the raw SQL queries Django is running?
    77----------------------------------------------------
    88
    9 Make sure your Django ``DEBUG`` setting is set to ``True``. Then, just do
     9Make sure your Django :setting:`DEBUG` setting is set to ``True``. Then, just do
    1010this::
    1111
    1212    >>> from django.db import connection
     
    1414    [{'sql': 'SELECT polls_polls.id,polls_polls.question,polls_polls.pub_date FROM polls_polls',
    1515    'time': '0.002'}]
    1616
    17 ``connection.queries`` is only available if ``DEBUG`` is ``True``. It's a list
     17``connection.queries`` is only available if :setting:`DEBUG` is ``True``. It's a list
    1818of dictionaries in order of query execution. Each dictionary has the following::
    1919
    2020    ``sql`` -- The raw SQL statement
     
    8989
    9090Django isn't known to leak memory. If you find your Django processes are
    9191allocating more and more memory, with no sign of releasing it, check to make
    92 sure your ``DEBUG`` setting is set to ``False``. If ``DEBUG`` is ``True``, then
     92sure your :setting:`DEBUG` setting is set to ``False``. If :setting:`DEBUG` is ``True``, then
    9393Django saves a copy of every SQL statement it has executed.
    9494
    9595(The queries are saved in ``django.db.connection.queries``. See
    9696`How can I see the raw SQL queries Django is running?`_.)
    9797
    98 To fix the problem, set ``DEBUG`` to ``False``.
     98To fix the problem, set :setting:`DEBUG` to ``False``.
    9999
    100100If you need to clear the query list manually at any point in your functions,
    101101just call ``reset_queries()``, like this::
  • docs/faq/admin.txt

     
    88sent out by Django doesn't match the domain in your browser. Try these two
    99things:
    1010
    11     * Set the ``SESSION_COOKIE_DOMAIN`` setting in your admin config file
     11    * Set the :setting:`SESSION_COOKIE_DOMAIN` setting in your admin config file
    1212      to match your domain. For example, if you're going to
    1313      "http://www.example.com/admin/" in your browser, in
    1414      "myproject.settings" you should set ``SESSION_COOKIE_DOMAIN = 'www.example.com'``.
     
    1717      don't have dots in them. If you're running the admin site on "localhost"
    1818      or another domain that doesn't have a dot in it, try going to
    1919      "localhost.localdomain" or "127.0.0.1". And set
    20       ``SESSION_COOKIE_DOMAIN`` accordingly.
     20      :setting:`SESSION_COOKIE_DOMAIN` accordingly.
    2121
    2222I can't log in. When I enter a valid username and password, it brings up the login page again, with a "Please enter a correct username and password" error.
    2323-----------------------------------------------------------------------------------------------------------------------------------------------------------
  • docs/ref/generic-views.txt

     
    5858      just before rendering the template.
    5959
    6060    * ``mimetype``: The MIME type to use for the resulting document. Defaults
    61       to the value of the ``DEFAULT_CONTENT_TYPE`` setting.
     61      to the value of the :setting:`DEFAULT_CONTENT_TYPE` setting.
    6262
    6363**Example:**
    6464
     
    198198      the view's template.
    199199
    200200    * ``mimetype``: The MIME type to use for the resulting document. Defaults
    201       to the value of the ``DEFAULT_CONTENT_TYPE`` setting.
     201      to the value of the :setting:`DEFAULT_CONTENT_TYPE` setting.
    202202
    203203    * ``allow_future``: A boolean specifying whether to include "future"
    204204      objects on this page, where "future" means objects in which the field
     
    290290      this is ``False``.
    291291
    292292    * ``mimetype``: The MIME type to use for the resulting document. Defaults
    293       to the value of the ``DEFAULT_CONTENT_TYPE`` setting.
     293      to the value of the :setting:`DEFAULT_CONTENT_TYPE` setting.
    294294
    295295    * ``allow_future``: A boolean specifying whether to include "future"
    296296      objects on this page, where "future" means objects in which the field
     
    377377      determining the variable's name.
    378378
    379379    * ``mimetype``: The MIME type to use for the resulting document. Defaults
    380       to the value of the ``DEFAULT_CONTENT_TYPE`` setting.
     380      to the value of the :setting:`DEFAULT_CONTENT_TYPE` setting.
    381381
    382382    * ``allow_future``: A boolean specifying whether to include "future"
    383383      objects on this page, where "future" means objects in which the field
     
    465465      determining the variable's name.
    466466
    467467    * ``mimetype``: The MIME type to use for the resulting document. Defaults
    468       to the value of the ``DEFAULT_CONTENT_TYPE`` setting.
     468      to the value of the :setting:`DEFAULT_CONTENT_TYPE` setting.
    469469
    470470    * ``allow_future``: A boolean specifying whether to include "future"
    471471      objects on this page, where "future" means objects in which the field
     
    550550      determining the variable's name.
    551551
    552552    * ``mimetype``: The MIME type to use for the resulting document. Defaults
    553       to the value of the ``DEFAULT_CONTENT_TYPE`` setting.
     553      to the value of the :setting:`DEFAULT_CONTENT_TYPE` setting.
    554554
    555555    * ``allow_future``: A boolean specifying whether to include "future"
    556556      objects on this page, where "future" means objects in which the field
     
    660660      to use in the template context. By default, this is ``'object'``.
    661661
    662662    * ``mimetype``: The MIME type to use for the resulting document. Defaults
    663       to the value of the ``DEFAULT_CONTENT_TYPE`` setting.
     663      to the value of the :setting:`DEFAULT_CONTENT_TYPE` setting.
    664664
    665665    * ``allow_future``: A boolean specifying whether to include "future"
    666666      objects on this page, where "future" means objects in which the field
     
    738738      determining the variable's name.
    739739
    740740    * ``mimetype``: The MIME type to use for the resulting document. Defaults
    741       to the value of the ``DEFAULT_CONTENT_TYPE`` setting.
     741      to the value of the :setting:`DEFAULT_CONTENT_TYPE` setting.
    742742
    743743**Template name:**
    744744
     
    852852      to use in the template context. By default, this is ``'object'``.
    853853
    854854    * ``mimetype``: The MIME type to use for the resulting document. Defaults
    855       to the value of the ``DEFAULT_CONTENT_TYPE`` setting.
     855      to the value of the :setting:`DEFAULT_CONTENT_TYPE` setting.
    856856
    857857**Template name:**
    858858
  • docs/ref/forms/fields.txt

     
    764764.. attribute:: URLField.validator_user_agent
    765765
    766766    String used as the user-agent used when checking for a URL's existence.
    767     Defaults to the value of the ``URL_VALIDATOR_USER_AGENT`` setting.
     767    Defaults to the value of the :setting:`URL_VALIDATOR_USER_AGENT` setting.
    768768
    769769.. versionchanged:: 1.2
    770770   The URLField previously did not recognize URLs as valid that contained an IDN
  • docs/ref/templates/api.txt

     
    462462If :setting:`TEMPLATE_CONTEXT_PROCESSORS` contains this processor, every
    463463``RequestContext`` will contain these two variables:
    464464
    465     * ``LANGUAGES`` -- The value of the :setting:`LANGUAGES` setting.
    466     * ``LANGUAGE_CODE`` -- ``request.LANGUAGE_CODE``, if it exists. Otherwise,
     465    * :setting:`LANGUAGES` -- The value of the :setting:`LANGUAGES` setting.
     466    * :setting:`LANGUAGE_CODE` -- ``request.LANGUAGE_CODE``, if it exists. Otherwise,
    467467      the value of the :setting:`LANGUAGE_CODE` setting.
    468468
    469469See :doc:`/topics/i18n/index` for more.
     
    472472~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    473473
    474474If :setting:`TEMPLATE_CONTEXT_PROCESSORS` contains this processor, every
    475 ``RequestContext`` will contain a variable ``MEDIA_URL``, providing the
     475``RequestContext`` will contain a variable :setting:`MEDIA_URL`, providing the
    476476value of the :setting:`MEDIA_URL` setting.
    477477
    478478django.core.context_processors.static
     
    481481.. versionadded:: 1.3
    482482
    483483If :setting:`TEMPLATE_CONTEXT_PROCESSORS` contains this processor, every
    484 ``RequestContext`` will contain a variable ``STATIC_URL``, providing the
     484``RequestContext`` will contain a variable :setting:`STATIC_URL`, providing the
    485485value of the :setting:`STATIC_URL` setting.
    486486
    487487django.core.context_processors.csrf
  • docs/ref/templates/builtins.txt

     
    13051305``datetime.datetime.now()``), the output will be the string
    13061306``'Wed 09 Jan 2008'``.
    13071307
    1308 The format passed can be one of the predefined ones ``DATE_FORMAT``,
    1309 ``DATETIME_FORMAT``, ``SHORT_DATE_FORMAT`` or ``SHORT_DATETIME_FORMAT``, or a
     1308The format passed can be one of the predefined ones :setting:`DATE_FORMAT`,
     1309:setting:`DATETIME_FORMAT`, :setting:`SHORT_DATE_FORMAT` or :setting:`SHORT_DATETIME_FORMAT`, or a
    13101310custom format that uses the format specifiers shown in the table above. Note
    13111311that predefined formats may vary depending on the current locale.
    13121312
     
    19391939
    19401940Formats a time according to the given format.
    19411941
    1942 Given format can be the predefined one ``TIME_FORMAT``, or a custom format,
     1942Given format can be the predefined one :setting:`TIME_FORMAT`, or a custom format,
    19431943same as the :tfilter:`date` filter. Note that the predefined format is locale-
    19441944dependant.
    19451945
     
    22412241-------------------------------
    22422242
    22432243Django comes with a couple of other template-tag libraries that you have to
    2244 enable explicitly in your ``INSTALLED_APPS`` setting and enable in your
     2244enable explicitly in your :setting:`INSTALLED_APPS` setting and enable in your
    22452245template with the ``{% load %}`` tag.
    22462246
    22472247django.contrib.humanize
     
    22722272
    22732273Provides a couple of templatetags that allow specifying translatable text in
    22742274Django templates. It is slightly different from the libraries described
    2275 above because you don't need to add any application to the ``INSTALLED_APPS``
     2275above because you don't need to add any application to the :setting:`INSTALLED_APPS`
    22762276setting but rather set :setting:`USE_I18N` to True, then loading it with
    22772277``{% load i18n %}``. See :ref:`specifying-translation-strings-in-template-code`.
    22782278
     
    22812281
    22822282Provides a couple of templatetags that allow control over the localization of
    22832283values in Django templates. It is slightly different from the libraries described
    2284 above because you don't need to add any application to the ``INSTALLED_APPS``;
     2284above because you don't need to add any application to the :setting:`INSTALLED_APPS`;
    22852285you only need to load the library using ``{% load l10n %}``. See
    22862286:ref:`topic-l10n-templates`.
  • docs/ref/contrib/gis/geoip.txt

     
    1818datasets in binary format (the CSV files will not work!).  These datasets may be
    1919`downloaded from MaxMind`__.  Grab the ``GeoIP.dat.gz`` and ``GeoLiteCity.dat.gz``
    2020and unzip them in a directory corresponding to what you set
    21 ``GEOIP_PATH`` with in your settings.  See the example and reference below
     21:setting:`GEOIP_PATH` with in your settings.  See the example and reference below
    2222for more details.
    2323
    2424__ http://www.maxmind.com/app/c
  • docs/ref/contrib/gis/install.txt

     
    180180
    181181.. _geoslibrarypath:
    182182
    183 ``GEOS_LIBRARY_PATH``
     183:setting:`GEOS_LIBRARY_PATH`
    184184~~~~~~~~~~~~~~~~~~~~~
    185185
    186186If your GEOS library is in a non-standard location, or you don't want to
     
    318318
    319319.. _gdallibrarypath:
    320320
    321 ``GDAL_LIBRARY_PATH``
     321:setting:`GDAL_LIBRARY_PATH`
    322322~~~~~~~~~~~~~~~~~~~~~
    323323
    324324If your GDAL library is in a non-standard location, or you don't want to
     
    592592__ http://www.gaia-gis.it/spatialite/resources.html
    593593
    594594
    595 Add ``django.contrib.gis`` to ``INSTALLED_APPS``
     595Add ``django.contrib.gis`` to :setting:`INSTALLED_APPS`
    596596------------------------------------------------
    597597
    598598Like other Django contrib applications, you will *only* need to add
  • docs/ref/contrib/gis/testing.txt

     
    2525
    2626.. setting:: POSTGIS_TEMPLATE
    2727
    28 ``POSTGIS_TEMPLATE``
     28:setting:`POSTGIS_TEMPLATE`
    2929^^^^^^^^^^^^^^^^^^^^
    3030
    3131.. versionchanged:: 1.2
     
    3737
    3838.. setting:: POSTGIS_VERSION
    3939
    40 ``POSTGIS_VERSION``
     40:setting:`POSTGIS_VERSION`
    4141^^^^^^^^^^^^^^^^^^^
    4242
    4343When GeoDjango's spatial backend initializes on PostGIS, it has to perform
     
    129129
    130130.. setting:: SPATIALITE_SQL
    131131
    132 ``SPATIALITE_SQL``
     132:setting:`SPATIALITE_SQL`
    133133^^^^^^^^^^^^^^^^^^
    134134
    135135By default, the GeoDjango test runner looks for the SpatiaLite SQL in the
  • docs/ref/contrib/index.txt

     
    1414
    1515    For most of these add-ons -- specifically, the add-ons that include either
    1616    models or template tags -- you'll need to add the package name (e.g.,
    17     ``'django.contrib.admin'``) to your ``INSTALLED_APPS`` setting and re-run
     17    ``'django.contrib.admin'``) to your :setting:`INSTALLED_APPS` setting and re-run
    1818    ``manage.py syncdb``.
    1919
    2020.. _"batteries included" philosophy: http://docs.python.org/tutorial/stdlib.html#batteries-included
  • docs/ref/contrib/messages.txt

     
    101101=========== ========
    102102Constant    Purpose
    103103=========== ========
    104 ``DEBUG``   Development-related messages that will be ignored (or removed) in a production deployment
     104:setting:`DEBUG`   Development-related messages that will be ignored (or removed) in a production deployment
    105105``INFO``    Informational messages for the user
    106106``SUCCESS`` An action was successful, e.g. "Your profile was updated successfully"
    107107``WARNING`` A failure did not occur but may be imminent
     
    128128==============  ===========
    129129Level Constant  Tag
    130130==============  ===========
    131 ``DEBUG``       ``debug``
     131:setting:`DEBUG`       ``debug``
    132132``INFO``        ``info``
    133133``SUCCESS``     ``success``
    134134``WARNING``     ``warning``
     
    202202==============  =====
    203203Level Constant  Value
    204204==============  =====
    205 ``DEBUG``       10
     205:setting:`DEBUG`       10
    206206``INFO``        20
    207207``SUCCESS``     25
    208208``WARNING``     30
     
    386386Default: ``None``
    387387
    388388The storage backends that use cookies -- ``CookieStorage`` and
    389 ``FallbackStorage`` -- use the value of ``SESSION_COOKIE_DOMAIN`` in
     389``FallbackStorage`` -- use the value of :setting:`SESSION_COOKIE_DOMAIN` in
    390390setting their cookies. See the :doc:`settings documentation </ref/settings>`
    391391for more information on how this works and why you might need to set it.
    392392
  • docs/ref/contrib/admin/index.txt

     
    17451745    )
    17461746
    17471747Above we used ``admin.autodiscover()`` to automatically load the
    1748 ``INSTALLED_APPS`` admin.py modules.
     1748:setting:`INSTALLED_APPS` admin.py modules.
    17491749
    17501750In this example, we register the ``AdminSite`` instance
    17511751``myproject.admin.admin_site`` at the URL ``/myadmin/`` ::
  • docs/ref/databases.txt

     
    262262       :setting:`HOST`, :setting:`PORT`
    263263    3. MySQL option files.
    264264
    265 In other words, if you set the name of the database in ``OPTIONS``,
    266 this will take precedence over ``NAME``, which would override
     265In other words, if you set the name of the database in :setting:`OPTIONS`,
     266this will take precedence over :setting:`NAME`, which would override
    267267anything in a `MySQL option file`_.
    268268
    269269Here's a sample configuration which uses a MySQL option file::
     
    574574
    575575If you don't use a ``tnsnames.ora`` file or a similar naming method that
    576576recognizes the SID ("xe" in this example), then fill in both
    577 ``HOST`` and ``PORT`` like so::
     577:setting:`HOST` and :setting:`PORT` like so::
    578578
    579579    DATABASES = {
    580580        'default': {
     
    587587        }
    588588    }
    589589
    590 You should supply both ``HOST`` and ``PORT``, or leave both
     590You should supply both :setting:`HOST` and :setting:`PORT`, or leave both
    591591as empty strings.
    592592
    593593Threaded option
  • docs/ref/django-admin.txt

     
    5757---------
    5858
    5959Many commands take a list of "app names." An "app name" is the basename of
    60 the package containing your models. For example, if your ``INSTALLED_APPS``
     60the package containing your models. For example, if your :setting:`INSTALLED_APPS`
    6161contains the string ``'mysite.blog'``, the app name is ``blog``.
    6262
    6363Determining the version
     
    126126
    127127Runs the command-line client for the database engine specified in your
    128128``ENGINE`` setting, with the connection parameters specified in your
    129 ``USER``, ``PASSWORD``, etc., settings.
     129:setting:`USER`, :setting:`PASSWORD`, etc., settings.
    130130
    131131    * For PostgreSQL, this runs the ``psql`` command-line client.
    132132    * For MySQL, this runs the ``mysql`` command-line client.
     
    151151settings.
    152152
    153153Settings that don't appear in the defaults are followed by ``"###"``. For
    154 example, the default settings don't define ``ROOT_URLCONF``, so
    155 ``ROOT_URLCONF`` is followed by ``"###"`` in the output of ``diffsettings``.
     154example, the default settings don't define :setting:`ROOT_URLCONF`, so
     155:setting:`ROOT_URLCONF` is followed by ``"###"`` in the output of ``diffsettings``.
    156156
    157157Note that Django's default settings live in ``django/conf/global_settings.py``,
    158158if you're ever curious to see the full list of defaults.
     
    245245.. django-admin:: inspectdb
    246246
    247247Introspects the database tables in the database pointed-to by the
    248 ``NAME`` setting and outputs a Django model module (a ``models.py``
     248:setting:`NAME` setting and outputs a Django model module (a ``models.py``
    249249file) to standard output.
    250250
    251251Use this if you have a legacy database with which you'd like to use Django.
     
    309309Django will search in three locations for fixtures:
    310310
    311311   1. In the ``fixtures`` directory of every installed application
    312    2. In any directory named in the ``FIXTURE_DIRS`` setting
     312   2. In any directory named in the :setting:`FIXTURE_DIRS` setting
    313313   3. In the literal path named by the fixture
    314314
    315315Django will load any and all fixtures it finds in these locations that match
     
    340340
    341341would search ``<appname>/fixtures/foo/bar/mydata.json`` for each installed
    342342application,  ``<dirname>/foo/bar/mydata.json`` for each directory in
    343 ``FIXTURE_DIRS``, and the literal path ``foo/bar/mydata.json``.
     343:setting:`FIXTURE_DIRS`, and the literal path ``foo/bar/mydata.json``.
    344344
    345345When fixture files are processed, the data is saved to the database as is.
    346346Model defined ``save`` methods and ``pre_save`` signals are not called.
     
    742742~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    743743
    744744By default, the development server doesn't serve any static files for your site
    745 (such as CSS files, images, things under ``MEDIA_URL`` and so forth). If
     745(such as CSS files, images, things under :setting:`MEDIA_URL` and so forth). If
    746746you want to configure Django to serve static media, read :doc:`/howto/static-files`.
    747747
    748748shell
     
    912912
    913913.. django-admin:: syncdb
    914914
    915 Creates the database tables for all apps in ``INSTALLED_APPS`` whose tables
     915Creates the database tables for all apps in :setting:`INSTALLED_APPS` whose tables
    916916have not already been created.
    917917
    918918Use this command when you've added new applications to your project and want to
    919919install them in the database. This includes any apps shipped with Django that
    920 might be in ``INSTALLED_APPS`` by default. When you start a new project, run
     920might be in :setting:`INSTALLED_APPS` by default. When you start a new project, run
    921921this command to install the default apps.
    922922
    923923.. admonition:: Syncdb will not alter existing tables
     
    10321032
    10331033.. django-admin:: validate
    10341034
    1035 Validates all installed models (according to the ``INSTALLED_APPS`` setting)
     1035Validates all installed models (according to the :setting:`INSTALLED_APPS` setting)
    10361036and prints validation errors to standard output.
    10371037
    10381038Commands provided by applications
  • docs/ref/settings.txt

     
    8686tag. This is a security measure, so that template authors can't access files
    8787that they shouldn't be accessing.
    8888
    89 For example, if ``ALLOWED_INCLUDE_ROOTS`` is ``('/home/html', '/var/www')``,
     89For example, if :setting:`ALLOWED_INCLUDE_ROOTS` is ``('/home/html', '/var/www')``,
    9090then ``{% ssi /home/html/foo.txt %}`` would work, but ``{% ssi /etc/passwd %}``
    9191wouldn't.
    9292
     
    102102same URL with a slash appended. Note that the redirect may cause any data
    103103submitted in a POST request to be lost.
    104104
    105 The ``APPEND_SLASH`` setting is only used if
     105The :setting:`APPEND_SLASH` setting is only used if
    106106:class:`~django.middleware.common.CommonMiddleware` is installed
    107107(see :doc:`/topics/http/middleware`). See also :setting:`PREPEND_WWW`.
    108108
     
    601601:tfilter:`allowed date format strings <date>`.
    602602
    603603.. versionchanged:: 1.2
    604     This setting can now be overriden by setting ``USE_L10N`` to ``True``.
     604    This setting can now be overriden by setting :setting:`USE_L10N` to ``True``.
    605605
    606 See also ``DATETIME_FORMAT``, ``TIME_FORMAT`` and ``SHORT_DATE_FORMAT``.
     606See also :setting:`DATETIME_FORMAT`, :setting:`TIME_FORMAT` and :setting:`SHORT_DATE_FORMAT`.
    607607
    608608.. setting:: DATE_INPUT_FORMATS
    609609
     
    624624syntax, that is different from the one used by Django for formatting dates
    625625to be displayed.
    626626
    627 See also ``DATETIME_INPUT_FORMATS`` and ``TIME_INPUT_FORMATS``.
     627See also :setting:`DATETIME_INPUT_FORMATS` and :setting:`TIME_INPUT_FORMATS`.
    628628
    629629.. _datetime: http://docs.python.org/library/datetime.html#strftime-strptime-behavior
    630630
     
    641641:tfilter:`allowed date format strings <date>`.
    642642
    643643.. versionchanged:: 1.2
    644     This setting can now be overriden by setting ``USE_L10N`` to ``True``.
     644    This setting can now be overriden by setting :setting:`USE_L10N` to ``True``.
    645645
    646 See also ``DATE_FORMAT``, ``TIME_FORMAT`` and ``SHORT_DATETIME_FORMAT``.
     646See also :setting:`DATE_FORMAT`, :setting:`TIME_FORMAT` and :setting:`SHORT_DATETIME_FORMAT`.
    647647
    648648.. setting:: DATETIME_INPUT_FORMATS
    649649
     
    664664syntax, that is different from the one used by Django for formatting dates
    665665to be displayed.
    666666
    667 See also ``DATE_INPUT_FORMATS`` and ``TIME_INPUT_FORMATS``.
     667See also :setting:`DATE_INPUT_FORMATS` and :setting:`TIME_INPUT_FORMATS`.
    668668
    669669.. _datetime: http://docs.python.org/library/datetime.html#strftime-strptime-behavior
    670670
     
    687687are inappropriate for public consumption. File paths, configuration options, and
    688688the like all give attackers extra information about your server.
    689689
    690 It is also important to remember that when running with ``DEBUG`` turned on, Django
     690It is also important to remember that when running with :setting:`DEBUG` turned on, Django
    691691will remember every SQL query it executes. This is useful when you are debugging,
    692692but on a production server, it will rapidly consume memory.
    693693
    694 Never deploy a site into production with ``DEBUG`` turned on.
     694Never deploy a site into production with :setting:`DEBUG` turned on.
    695695
    696696.. _django/views/debug.py: http://code.djangoproject.com/browser/django/trunk/django/views/debug.py
    697697
     
    724724Default: ``'utf-8'``
    725725
    726726Default charset to use for all ``HttpResponse`` objects, if a MIME type isn't
    727 manually specified. Used with ``DEFAULT_CONTENT_TYPE`` to construct the
     727manually specified. Used with :setting:`DEFAULT_CONTENT_TYPE` to construct the
    728728``Content-Type`` header.
    729729
    730730.. setting:: DEFAULT_CONTENT_TYPE
     
    735735Default: ``'text/html'``
    736736
    737737Default content type to use for all ``HttpResponse`` objects, if a MIME type
    738 isn't manually specified. Used with ``DEFAULT_CHARSET`` to construct the
     738isn't manually specified. Used with :setting:`DEFAULT_CHARSET` to construct the
    739739``Content-Type`` header.
    740740
    741741.. setting:: DEFAULT_FILE_STORAGE
     
    822822
    823823The host to use for sending email.
    824824
    825 See also ``EMAIL_PORT``.
     825See also :setting:`EMAIL_PORT`.
    826826
    827827.. setting:: EMAIL_HOST_PASSWORD
    828828
     
    831831
    832832Default: ``''`` (Empty string)
    833833
    834 Password to use for the SMTP server defined in ``EMAIL_HOST``. This setting is
    835 used in conjunction with ``EMAIL_HOST_USER`` when authenticating to the SMTP
     834Password to use for the SMTP server defined in :setting:`EMAIL_HOST`. This setting is
     835used in conjunction with :setting:`EMAIL_HOST_USER` when authenticating to the SMTP
    836836server. If either of these settings is empty, Django won't attempt
    837837authentication.
    838838
    839 See also ``EMAIL_HOST_USER``.
     839See also :setting:`EMAIL_HOST_USER`.
    840840
    841841.. setting:: EMAIL_HOST_USER
    842842
     
    845845
    846846Default: ``''`` (Empty string)
    847847
    848 Username to use for the SMTP server defined in ``EMAIL_HOST``. If empty,
     848Username to use for the SMTP server defined in :setting:`EMAIL_HOST`. If empty,
    849849Django won't attempt authentication.
    850850
    851 See also ``EMAIL_HOST_PASSWORD``.
     851See also :setting:`EMAIL_HOST_PASSWORD`.
    852852
    853853.. setting:: EMAIL_PORT
    854854
     
    857857
    858858Default: ``25``
    859859
    860 Port to use for the SMTP server defined in ``EMAIL_HOST``.
     860Port to use for the SMTP server defined in :setting:`EMAIL_HOST`.
    861861
    862862.. setting:: EMAIL_SUBJECT_PREFIX
    863863
     
    10041004file, under the directory named as the current locale, and will use the
    10051005formats defined on this file.
    10061006
    1007 For example, if ``FORMAT_MODULE_PATH`` is set to ``mysite.formats``, and
     1007For example, if :setting:`FORMAT_MODULE_PATH` is set to ``mysite.formats``, and
    10081008current language is ``en`` (English), Django will expect a directory tree
    10091009like::
    10101010
     
    10151015                __init__.py
    10161016                formats.py
    10171017
    1018 Available formats are ``DATE_FORMAT``, ``TIME_FORMAT``, ``DATETIME_FORMAT``,
    1019 ``YEAR_MONTH_FORMAT``, ``MONTH_DAY_FORMAT``, ``SHORT_DATE_FORMAT``,
    1020 ``SHORT_DATETIME_FORMAT``, ``FIRST_DAY_OF_WEEK``, ``DECIMAL_SEPARATOR``,
    1021 ``THOUSAND_SEPARATOR`` and ``NUMBER_GROUPING``.
     1018Available formats are :setting:`DATE_FORMAT`, :setting:`TIME_FORMAT`, :setting:`DATETIME_FORMAT`,
     1019:setting:`YEAR_MONTH_FORMAT`, :setting:`MONTH_DAY_FORMAT`, :setting:`SHORT_DATE_FORMAT`,
     1020:setting:`SHORT_DATETIME_FORMAT`, :setting:`FIRST_DAY_OF_WEEK`, :setting:`DECIMAL_SEPARATOR`,
     1021:setting:`THOUSAND_SEPARATOR` and :setting:`NUMBER_GROUPING`.
    10221022
    10231023.. setting:: IGNORABLE_404_URLS
    10241024
     
    10671067
    10681068A tuple of IP addresses, as strings, that:
    10691069
    1070     * See debug comments, when ``DEBUG`` is ``True``
     1070    * See debug comments, when :setting:`DEBUG` is ``True``
    10711071    * Receive X headers if the ``XViewMiddleware`` is installed (see
    10721072      :doc:`/topics/http/middleware`)
    10731073
     
    10901090Default: ``'django_language'``
    10911091
    10921092The name of the cookie to use for the language cookie. This can be whatever you
    1093 want (but should be different from ``SESSION_COOKIE_NAME``). See
     1093want (but should be different from :setting:`SESSION_COOKIE_NAME`). See
    10941094:doc:`/topics/i18n/index`.
    10951095
    10961096.. setting:: LANGUAGES
     
    11141114Generally, the default value should suffice. Only set this setting if you want
    11151115to restrict language selection to a subset of the Django-provided languages.
    11161116
    1117 If you define a custom ``LANGUAGES`` setting, it's OK to mark the languages as
     1117If you define a custom :setting:`LANGUAGES` setting, it's OK to mark the languages as
    11181118translation strings (as in the default value referred to above) -- but use a
    11191119"dummy" ``gettext()`` function, not the one in ``django.utils.translation``.
    11201120You should *never* import ``django.utils.translation`` from within your
     
    11341134With this arrangement, ``django-admin.py makemessages`` will still find and
    11351135mark these strings for translation, but the translation won't happen at
    11361136runtime -- so you'll have to remember to wrap the languages in the *real*
    1137 ``gettext()`` in any code that uses ``LANGUAGES`` at runtime.
     1137``gettext()`` in any code that uses :setting:`LANGUAGES` at runtime.
    11381138
    11391139.. setting:: LOCALE_PATHS
    11401140
     
    12301230
    12311231Default: ``()`` (Empty tuple)
    12321232
    1233 A tuple in the same format as ``ADMINS`` that specifies who should get
     1233A tuple in the same format as :setting:`ADMINS` that specifies who should get
    12341234broken-link notifications when ``SEND_BROKEN_LINK_EMAILS=True``.
    12351235
    12361236.. setting:: MEDIA_ROOT
     
    13351335locales have different formats. For example, U.S. English would say
    13361336"January 1," whereas Spanish might say "1 Enero."
    13371337
    1338 See :tfilter:`allowed date format strings <date>`. See also ``DATE_FORMAT``,
    1339 ``DATETIME_FORMAT``, ``TIME_FORMAT`` and ``YEAR_MONTH_FORMAT``.
     1338See :tfilter:`allowed date format strings <date>`. See also :setting:`DATE_FORMAT`,
     1339:setting:`DATETIME_FORMAT`, :setting:`TIME_FORMAT` and :setting:`YEAR_MONTH_FORMAT`.
    13401340
    13411341.. setting:: NUMBER_GROUPING
    13421342
     
    14301430
    14311431Default: ``False``
    14321432
    1433 Whether to send an email to the ``MANAGERS`` each time somebody visits a
     1433Whether to send an email to the :setting:`MANAGERS` each time somebody visits a
    14341434Django-powered page that is 404ed with a non-empty referer (i.e., a broken
    14351435link). This is only used if ``CommonMiddleware`` is installed (see
    1436 :doc:`/topics/http/middleware`). See also ``IGNORABLE_404_URLS`` and
     1436:doc:`/topics/http/middleware`). See also :setting:`IGNORABLE_404_URLS` and
    14371437:doc:`/howto/error-reporting`.
    14381438
    14391439.. setting:: SERIALIZATION_MODULES
     
    14571457Default: ``'root@localhost'``
    14581458
    14591459The email address that error messages come from, such as those sent to
    1460 ``ADMINS`` and ``MANAGERS``.
     1460:setting:`ADMINS` and :setting:`MANAGERS`.
    14611461
    14621462.. setting:: SESSION_COOKIE_AGE
    14631463
     
    15061506Default: ``'sessionid'``
    15071507
    15081508The name of the cookie to use for sessions. This can be whatever you want (but
    1509 should be different from ``LANGUAGE_COOKIE_NAME``). See the :doc:`/topics/http/sessions`.
     1509should be different from :setting:`LANGUAGE_COOKIE_NAME`). See the :doc:`/topics/http/sessions`.
    15101510
    15111511.. setting:: SESSION_COOKIE_PATH
    15121512
     
    15961596corresponding locale-dictated format has higher precedence and will be applied.
    15971597See :tfilter:`allowed date format strings <date>`.
    15981598
    1599 See also ``DATE_FORMAT`` and ``SHORT_DATETIME_FORMAT``.
     1599See also :setting:`DATE_FORMAT` and :setting:`SHORT_DATETIME_FORMAT`.
    16001600
    16011601.. setting:: SHORT_DATETIME_FORMAT
    16021602
     
    16121612corresponding locale-dictated format has higher precedence and will be applied.
    16131613See :tfilter:`allowed date format strings <date>`.
    16141614
    1615 See also ``DATE_FORMAT`` and ``SHORT_DATETIME_FORMAT``.
     1615See also :setting:`DATE_FORMAT` and :setting:`SHORT_DATETIME_FORMAT`.
    16161616
    16171617.. setting:: SITE_ID
    16181618
     
    17211721report contains the relevant snippet of the template, with the appropriate line
    17221722highlighted.
    17231723
    1724 Note that Django only displays fancy error pages if ``DEBUG`` is ``True``, so
     1724Note that Django only displays fancy error pages if :setting:`DEBUG` is ``True``, so
    17251725you'll want to set that to take advantage of this setting.
    17261726
    1727 See also ``DEBUG``.
     1727See also :setting:`DEBUG`.
    17281728
    17291729.. setting:: TEMPLATE_DIRS
    17301730
     
    17561756
    17571757.. versionchanged:: 1.2
    17581758    The class-based API for template loaders was introduced in Django 1.2
    1759     although  the ``TEMPLATE_LOADERS`` setting will accept strings that specify
     1759    although  the :setting:`TEMPLATE_LOADERS` setting will accept strings that specify
    17601760    function-based loaders until compatibility with them is completely removed in
    17611761    Django 1.4.
    17621762
     
    17951795Default ``,`` (Comma)
    17961796
    17971797Default thousand separator used when formatting numbers. This setting is
    1798 used only when ``NUMBER_GROUPING`` and ``USE_THOUSAND_SEPARATOR`` are set.
     1798used only when :setting:`NUMBER_GROUPING` and :setting:`USE_THOUSAND_SEPARATOR` are set.
    17991799
    18001800See also :setting:`NUMBER_GROUPING`, :setting:`DECIMAL_SEPARATOR` and
    18011801:setting:`USE_THOUSAND_SEPARATOR`.
     
    18131813:tfilter:`allowed date format strings <date>`.
    18141814
    18151815.. versionchanged:: 1.2
    1816     This setting can now be overriden by setting ``USE_L10N`` to ``True``.
     1816    This setting can now be overriden by setting :setting:`USE_L10N` to ``True``.
    18171817
    1818 See also ``DATE_FORMAT`` and ``DATETIME_FORMAT``.
     1818See also :setting:`DATE_FORMAT` and :setting:`DATETIME_FORMAT`.
    18191819
    18201820.. setting:: TIME_INPUT_FORMATS
    18211821
     
    18321832syntax, that is different from the one used by Django for formatting dates
    18331833to be displayed.
    18341834
    1835 See also ``DATE_INPUT_FORMATS`` and ``DATETIME_INPUT_FORMATS``.
     1835See also :setting:`DATE_INPUT_FORMATS` and :setting:`DATETIME_INPUT_FORMATS`.
    18361836
    18371837.. _datetime: http://docs.python.org/library/datetime.html#strftime-strptime-behavior
    18381838
     
    18511851choices lists more than one on the same line; you'll want to use just
    18521852one of the choices for a given time zone. For instance, one line says
    18531853``'Europe/London GB GB-Eire'``, but you should use the first bit of
    1854 that -- ``'Europe/London'`` -- as your ``TIME_ZONE`` setting.)
     1854that -- ``'Europe/London'`` -- as your :setting:`TIME_ZONE` setting.)
    18551855
    18561856Note that this is the time zone to which Django will convert all
    18571857dates/times -- not necessarily the timezone of the server. For
     
    18591859a separate time-zone setting.
    18601860
    18611861Normally, Django sets the ``os.environ['TZ']`` variable to the time
    1862 zone you specify in the ``TIME_ZONE`` setting. Thus, all your views
     1862zone you specify in the :setting:`TIME_ZONE` setting. Thus, all your views
    18631863and models will automatically operate in the correct time zone.
    18641864However, Django won't set the ``TZ`` environment variable under the
    18651865following conditions:
     
    19161916set to ``False``, Django will make some optimizations so as not to load the
    19171917internationalization machinery.
    19181918
    1919 See also ``USE_L10N``
     1919See also :setting:`USE_L10N`
    19201920
    19211921.. setting:: USE_L10N
    19221922
     
    19311931is set to ``True``, e.g. Django will display numbers and dates using the
    19321932format of the current locale.
    19331933
    1934 See also ``USE_I18N`` and ``LANGUAGE_CODE``
     1934See also :setting:`USE_I18N` and :setting:`LANGUAGE_CODE`
    19351935
    19361936.. setting:: USE_THOUSAND_SEPARATOR
    19371937
     
    19431943Default ``False``
    19441944
    19451945A boolean that specifies wheter to display numbers using a thousand separator.
    1946 If this is set to ``True``, Django will use values from ``THOUSAND_SEPARATOR``
    1947 and ``NUMBER_GROUPING`` from current locale, to format the number.
    1948 ``USE_L10N`` must be set to ``True``, in order to format numbers.
     1946If this is set to ``True``, Django will use values from :setting:`THOUSAND_SEPARATOR`
     1947and :setting:`NUMBER_GROUPING` from current locale, to format the number.
     1948:setting:`USE_L10N` must be set to ``True``, in order to format numbers.
    19491949
    1950 See also ``THOUSAND_SEPARATOR`` and ``NUMBER_GROUPING``.
     1950See also :setting:`THOUSAND_SEPARATOR` and :setting:`NUMBER_GROUPING`.
    19511951
    19521952.. setting:: YEAR_MONTH_FORMAT
    19531953
     
    19651965Different locales have different formats. For example, U.S. English would say
    19661966"January 2006," whereas another locale might say "2006/January."
    19671967
    1968 See :tfilter:`allowed date format strings <date>`. See also ``DATE_FORMAT``,
    1969 ``DATETIME_FORMAT``, ``TIME_FORMAT`` and ``MONTH_DAY_FORMAT``.
     1968See :tfilter:`allowed date format strings <date>`. See also :setting:`DATE_FORMAT`,
     1969:setting:`DATETIME_FORMAT`, :setting:`TIME_FORMAT` and :setting:`MONTH_DAY_FORMAT`.
    19701970
    19711971Deprecated settings
    19721972===================
  • docs/ref/utils.txt

     
    6161
    6262    Each header is only added if it isn't already set.
    6363
    64     ``cache_timeout`` is in seconds. The ``CACHE_MIDDLEWARE_SECONDS`` setting
     64    ``cache_timeout`` is in seconds. The :setting:`CACHE_MIDDLEWARE_SECONDS` setting
    6565    is used by default.
    6666
    6767.. function:: add_never_cache_headers(response)
Back to Top