1
0
mirror of https://github.com/django/django.git synced 2025-10-31 09:41:08 +00:00

Refs #36485 -- Rewrapped docs to 79 columns line length.

Lines in the docs files were manually adjusted to conform to the
79 columns limit per line (plus newline), improving readability and
consistency across the content.
This commit is contained in:
David Smith
2025-07-25 10:24:17 +01:00
committed by nessita
parent 4286a23df6
commit f81e6e3a53
230 changed files with 3250 additions and 2914 deletions

View File

@@ -168,8 +168,8 @@ backend class (i.e. ``mypackage.backends.whatever.WhateverCache``).
``KEY_FUNCTION``
~~~~~~~~~~~~~~~~
A string containing a dotted path to a function (or any callable) that defines how to
compose a prefix, version and key into a final cache key. The default
A string containing a dotted path to a function (or any callable) that defines
how to compose a prefix, version and key into a final cache key. The default
implementation is equivalent to the function::
def make_key(key, key_prefix, version):
@@ -1116,7 +1116,8 @@ The default formatting to use for displaying date fields in any part of the
system. Note that the locale-dictated format has higher precedence and will be
applied instead. See :tfilter:`allowed date format strings <date>`.
See also :setting:`DATETIME_FORMAT`, :setting:`TIME_FORMAT` and :setting:`SHORT_DATE_FORMAT`.
See also :setting:`DATETIME_FORMAT`, :setting:`TIME_FORMAT` and
:setting:`SHORT_DATE_FORMAT`.
.. setting:: DATE_INPUT_FORMATS
@@ -1160,7 +1161,8 @@ The default formatting to use for displaying datetime fields in any part of the
system. Note that the locale-dictated format has higher precedence and will be
applied instead. See :tfilter:`allowed date format strings <date>`.
See also :setting:`DATE_FORMAT`, :setting:`TIME_FORMAT` and :setting:`SHORT_DATETIME_FORMAT`.
See also :setting:`DATE_FORMAT`, :setting:`TIME_FORMAT` and
:setting:`SHORT_DATETIME_FORMAT`.
.. setting:: DATETIME_INPUT_FORMATS
@@ -1458,9 +1460,9 @@ Port to use for the SMTP server defined in :setting:`EMAIL_HOST`.
Default: ``'[Django] '``
Subject-line prefix for email messages sent with ``django.core.mail.mail_admins``
or ``django.core.mail.mail_managers``. You'll probably want to include the
trailing space.
Subject-line prefix for email messages sent with
``django.core.mail.mail_admins`` or ``django.core.mail.mail_managers``. You'll
probably want to include the trailing space.
.. setting:: EMAIL_USE_LOCALTIME
@@ -1536,11 +1538,11 @@ If :setting:`EMAIL_USE_SSL` or :setting:`EMAIL_USE_TLS` is ``True``, you can
optionally specify the path to a PEM-formatted private key file for client
authentication of the SSL connection along with :setting:`EMAIL_SSL_CERTFILE`.
Note that setting :setting:`EMAIL_SSL_CERTFILE` and :setting:`EMAIL_SSL_KEYFILE`
doesn't result in any certificate checking. They're passed to the underlying SSL
connection. Please refer to the documentation of Python's
:meth:`python:ssl.SSLContext.wrap_socket` function for details on how the
certificate chain file and private key file are handled.
Note that setting :setting:`EMAIL_SSL_CERTFILE` and
:setting:`EMAIL_SSL_KEYFILE` doesn't result in any certificate checking.
They're passed to the underlying SSL connection. Please refer to the
documentation of Python's :meth:`python:ssl.SSLContext.wrap_socket` function
for details on how the certificate chain file and private key file are handled.
.. setting:: EMAIL_TIMEOUT
@@ -1843,17 +1845,17 @@ A list of IP addresses, as strings, that:
Default: ``'en-us'``
A string representing the language code for this installation. This should be in
standard :term:`language ID format <language code>`. For example, U.S. English
is ``"en-us"``. See also the `list of language identifiers`_ and
A string representing the language code for this installation. This should be
in standard :term:`language ID format <language code>`. For example, U.S.
English is ``"en-us"``. See also the `list of language identifiers`_ and
:doc:`/topics/i18n/index`.
It serves three purposes:
* If the locale middleware isn't in use, it decides which translation is served
to all users.
* If the locale middleware is active, it provides a fallback language in case the
user's preferred language can't be determined or is not supported by the
* If the locale middleware is active, it provides a fallback language in case
the user's preferred language can't be determined or is not supported by the
website. It also provides the fallback translation when a translation for a
given literal doesn't exist for the user's preferred language.
* If localization is explicitly disabled via the :tfilter:`unlocalize` filter
@@ -1927,19 +1929,19 @@ application). See :doc:`/topics/i18n/index`.
Default: ``'/'``
The path set on the language cookie. This should either match the URL path of your
Django installation or be a parent of that path.
The path set on the language cookie. This should either match the URL path of
your Django installation or be a parent of that path.
This is useful if you have multiple Django instances running under the same
hostname. They can use different cookie paths and each instance will only see
its own language cookie.
Be cautious when updating this setting on a production site. If you update this
setting to use a deeper path than it previously used, existing user cookies that
have the old path will not be updated. This will result in site users being
unable to switch the language as long as these cookies persist. The only safe
and reliable option to perform the switch is to change the language cookie name
permanently (via the :setting:`LANGUAGE_COOKIE_NAME` setting), and to add
setting to use a deeper path than it previously used, existing user cookies
that have the old path will not be updated. This will result in site users
being unable to switch the language as long as these cookies persist. The only
safe and reliable option to perform the switch is to change the language cookie
name permanently (via the :setting:`LANGUAGE_COOKIE_NAME` setting), and to add
a middleware that copies the value from the old cookie to a new one and then
deletes the one.
@@ -1950,8 +1952,8 @@ deletes the one.
Default: ``None``
The value of the `SameSite`_ flag on the language cookie. This flag prevents the
cookie from being sent in cross-site requests.
The value of the `SameSite`_ flag on the language cookie. This flag prevents
the cookie from being sent in cross-site requests.
See :setting:`SESSION_COOKIE_SAMESITE` for details about ``SameSite``.
@@ -2032,8 +2034,9 @@ Example::
"/var/local/translations/locale",
]
Django will look within each of these paths for the ``<locale_code>/LC_MESSAGES``
directories containing the actual translation files.
Django will look within each of these paths for the
``<locale_code>/LC_MESSAGES`` directories containing the actual translation
files.
.. setting:: LOGGING
@@ -2243,8 +2246,8 @@ See also :setting:`DECIMAL_SEPARATOR`, :setting:`THOUSAND_SEPARATOR` and
Default: ``False``
Whether to prepend the "www." subdomain to URLs that don't have it. This is only
used if :class:`~django.middleware.common.CommonMiddleware` is installed
Whether to prepend the "www." subdomain to URLs that don't have it. This is
only used if :class:`~django.middleware.common.CommonMiddleware` is installed
(see :doc:`/topics/http/middleware`). See also :setting:`APPEND_SLASH`.
.. setting:: ROOT_URLCONF
@@ -2459,9 +2462,9 @@ Following the example from the :setting:`SECURE_CSP` setting::
Default: ``False``
If ``True``, the :class:`~django.middleware.security.SecurityMiddleware` adds
the ``includeSubDomains`` directive to the :ref:`http-strict-transport-security`
header. It has no effect unless :setting:`SECURE_HSTS_SECONDS` is set to a
non-zero value.
the ``includeSubDomains`` directive to the
:ref:`http-strict-transport-security` header. It has no effect unless
:setting:`SECURE_HSTS_SECONDS` is set to a non-zero value.
.. warning::
Setting this incorrectly can irreversibly (for the value of
@@ -2570,8 +2573,8 @@ available in ``request.META``.)
Default: ``[]`` (Empty list)
If a URL path matches a regular expression in this list, the request will not be
redirected to HTTPS. The
If a URL path matches a regular expression in this list, the request will not
be redirected to HTTPS. The
:class:`~django.middleware.security.SecurityMiddleware` strips leading slashes
from URL paths, so patterns shouldn't include them, e.g.
``SECURE_REDIRECT_EXEMPT = [r'^no-ssl/$', …]``. If
@@ -2596,8 +2599,8 @@ to the value provided.
Default: ``None``
If a string (e.g. ``secure.example.com``), all SSL redirects will be directed
to this host rather than the originally-requested host
(e.g. ``www.example.com``). If :setting:`SECURE_SSL_REDIRECT` is ``False``, this
to this host rather than the originally-requested host (e.g.
``www.example.com``). If :setting:`SECURE_SSL_REDIRECT` is ``False``, this
setting has no effect.
.. setting:: SECURE_SSL_REDIRECT
@@ -3015,7 +3018,8 @@ See also :setting:`DECIMAL_SEPARATOR`, :setting:`NUMBER_GROUPING` and
Default: ``True``
A boolean that specifies if datetimes will be timezone-aware by default or not.
If this is set to ``True``, Django will use timezone-aware datetimes internally.
If this is set to ``True``, Django will use timezone-aware datetimes
internally.
When ``USE_TZ`` is False, Django will use naive datetimes in local time, except
when parsing ISO 8601 formatted strings, where timezone information will always
@@ -3282,13 +3286,15 @@ Controls where Django stores message data. Valid values are:
* ``'django.contrib.messages.storage.session.SessionStorage'``
* ``'django.contrib.messages.storage.cookie.CookieStorage'``
See :ref:`message storage backends <message-storage-backends>` for more details.
See :ref:`message storage backends <message-storage-backends>` for more
details.
The backends that use cookies --
:class:`~django.contrib.messages.storage.cookie.CookieStorage` and
:class:`~django.contrib.messages.storage.fallback.FallbackStorage` --
use the value of :setting:`SESSION_COOKIE_DOMAIN`, :setting:`SESSION_COOKIE_SECURE`
and :setting:`SESSION_COOKIE_HTTPONLY` when setting their cookies.
use the value of :setting:`SESSION_COOKIE_DOMAIN`,
:setting:`SESSION_COOKIE_SECURE` and :setting:`SESSION_COOKIE_HTTPONLY` when
setting their cookies.
.. setting:: MESSAGE_TAGS
@@ -3412,8 +3418,8 @@ The name of the cookie to use for sessions. This can be whatever you want
Default: ``'/'``
The path set on the session cookie. This should either match the URL path of your
Django installation or be parent of that path.
The path set on the session cookie. This should either match the URL path of
your Django installation or be parent of that path.
This is useful if you have multiple Django instances running under the same
hostname. They can use different cookie paths, and each instance will only see