summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAymeric Augustin <aymeric.augustin@m4x.org>2015-02-10 21:37:53 +0100
committerAymeric Augustin <aymeric.augustin@m4x.org>2015-02-10 21:37:53 +0100
commitc7a6996df7e77bc3b9c5e581e67d766627ebabec (patch)
tree88b4b5ca3e3d18b4676dd9dd473804c86dd4caaf
parente9874d4cf1f582dd78ad171b4e7ce62f3199390f (diff)
Fixed a crash of the debug page.
During the autumn DST change, the template engine would fail to convert the naive representation of now when USE_TZ = True. Passing now in UTC eliminates the issue. Thanks mbertheau and tricoder42. Refs #23714.
-rw-r--r--django/views/debug.py5
1 files changed, 2 insertions, 3 deletions
diff --git a/django/views/debug.py b/django/views/debug.py
index 0a4aa8f74d..80b0e38eb1 100644
--- a/django/views/debug.py
+++ b/django/views/debug.py
@@ -1,6 +1,5 @@
from __future__ import unicode_literals
-import datetime
import os
import re
import sys
@@ -13,7 +12,7 @@ from django.http import (
)
from django.template import Context, Engine, TemplateDoesNotExist
from django.template.defaultfilters import force_escape, pprint
-from django.utils import lru_cache, six
+from django.utils import lru_cache, six, timezone
from django.utils.datastructures import MultiValueDict
from django.utils.encoding import force_bytes, smart_text
from django.utils.html import escape
@@ -362,7 +361,7 @@ class ExceptionReporter(object):
'settings': get_safe_settings(),
'sys_executable': sys.executable,
'sys_version_info': '%d.%d.%d' % sys.version_info[0:3],
- 'server_time': datetime.datetime.now(),
+ 'server_time': timezone.now(),
'django_version_info': get_version(),
'sys_path': sys.path,
'template_info': self.template_info,