Fixed #6486 -- Added local server time to the debug output page. Patch from

Bastian Kleineidam and Thomas Güttler.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@7333 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
Malcolm Tredinnick 2008-03-20 07:01:26 +00:00
parent f8578d7f19
commit c01e6b852a
1 changed files with 6 additions and 0 deletions

View File

@ -1,6 +1,7 @@
import os import os
import re import re
import sys import sys
import datetime
from django.conf import settings from django.conf import settings
from django.template import Template, Context, TemplateDoesNotExist from django.template import Template, Context, TemplateDoesNotExist
@ -158,6 +159,7 @@ def get_traceback_html(request, exc_type, exc_value, tb):
'settings': get_safe_settings(), 'settings': get_safe_settings(),
'sys_executable': sys.executable, 'sys_executable': sys.executable,
'sys_version_info': '%d.%d.%d' % sys.version_info[0:3], 'sys_version_info': '%d.%d.%d' % sys.version_info[0:3],
'server_time': datetime.datetime.now(),
'django_version_info': get_version(), 'django_version_info': get_version(),
'sys_path' : sys.path, 'sys_path' : sys.path,
'template_info': template_info, 'template_info': template_info,
@ -389,6 +391,10 @@ TECHNICAL_500_TEMPLATE = """
<th>Python Path:</th> <th>Python Path:</th>
<td>{{ sys_path }}</td> <td>{{ sys_path }}</td>
</tr> </tr>
<tr>
<th>Server time:</th>
<td>{{server_time|date:"r"}}</td>
</tr>
</table> </table>
</div> </div>
{% if unicode_hint %} {% if unicode_hint %}