summaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorAymeric Augustin <aymeric.augustin@m4x.org>2013-05-15 16:43:39 +0200
committerAymeric Augustin <aymeric.augustin@m4x.org>2013-05-15 16:43:39 +0200
commitc8dcee9a423fa3f31a2303e7ec20a924775730a2 (patch)
tree00a2aed9e7f507a1073b7c5e180fae3e82d549f2 /docs
parent84d8b247d20aafb376368dc458f277ad2cd71ecd (diff)
Improved the timezone middleware example slightly.
This change avoids having the timezone leak from a request to the next.
Diffstat (limited to 'docs')
-rw-r--r--docs/topics/i18n/timezones.txt2
1 files changed, 2 insertions, 0 deletions
diff --git a/docs/topics/i18n/timezones.txt b/docs/topics/i18n/timezones.txt
index 22a0edb073..e4a043b08f 100644
--- a/docs/topics/i18n/timezones.txt
+++ b/docs/topics/i18n/timezones.txt
@@ -189,6 +189,8 @@ Add the following middleware to :setting:`MIDDLEWARE_CLASSES`::
tz = request.session.get('django_timezone')
if tz:
timezone.activate(tz)
+ else:
+ timezone.deactivate()
Create a view that can set the current timezone::