mirror of
https://github.com/django/django.git
synced 2025-03-31 19:46:42 +00:00
[1.10.x] Fixed #26754 -- Documented django.template.context_processors.tz
Backport of 7003174fec188bd5a21e3d62bd5e13e80f6f329c from master
This commit is contained in:
parent
8f91c42b58
commit
61bcf04132
@ -746,6 +746,14 @@ tag for protection against :doc:`Cross Site Request Forgeries
|
|||||||
If this processor is enabled, every ``RequestContext`` will contain a variable
|
If this processor is enabled, every ``RequestContext`` will contain a variable
|
||||||
``request``, which is the current :class:`~django.http.HttpRequest`.
|
``request``, which is the current :class:`~django.http.HttpRequest`.
|
||||||
|
|
||||||
|
``django.template.context_processors.tz``
|
||||||
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
|
.. function:: tz
|
||||||
|
|
||||||
|
If this processor is enabled, every ``RequestContext`` will contain a variable
|
||||||
|
``TIME_ZONE``, providing the name of the currently active time zone.
|
||||||
|
|
||||||
``django.contrib.messages.context_processors.messages``
|
``django.contrib.messages.context_processors.messages``
|
||||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
|
@ -315,9 +315,9 @@ You can get the name of the current time zone using the
|
|||||||
|
|
||||||
{% get_current_timezone as TIME_ZONE %}
|
{% get_current_timezone as TIME_ZONE %}
|
||||||
|
|
||||||
If you enable the ``django.template.context_processors.tz`` context processor,
|
Alternatively, you can activate the
|
||||||
each :class:`~django.template.RequestContext` will contain a ``TIME_ZONE``
|
:func:`~django.template.context_processors.tz` context processor and
|
||||||
variable with the value of ``get_current_timezone()``.
|
use the ``TIME_ZONE`` context variable.
|
||||||
|
|
||||||
Template filters
|
Template filters
|
||||||
----------------
|
----------------
|
||||||
|
Loading…
x
Reference in New Issue
Block a user