From 6970bb9855d8bf3728995235923fee084d651b2c Mon Sep 17 00:00:00 2001
From: Bastian Kleineidam <calvin@debian.org>
Date: Fri, 25 Jan 2008 18:14:22 +0100
Subject: Add server time to error page info
Add the local server time to the HTTP 500 error page info.
Signed-off-by: Bastian Kleineidam <calvin@debian.org>
diff --git a/django/views/debug.py b/django/views/debug.py
index e3be2a7..c31e9aa 100644
a
|
b
|
|
1 | 1 | import os |
2 | 2 | import re |
3 | 3 | import sys |
| 4 | import datetime |
4 | 5 | |
5 | 6 | from django.conf import settings |
6 | 7 | from django.template import Template, Context, TemplateDoesNotExist |
… |
… |
def technical_500_response(request, exc_type, exc_value, tb):
|
147 | 148 | 'settings': get_safe_settings(), |
148 | 149 | 'sys_executable': sys.executable, |
149 | 150 | 'sys_version_info': '%d.%d.%d' % sys.version_info[0:3], |
| 151 | 'server_time': datetime.datetime.now(), |
150 | 152 | 'django_version_info': get_version(), |
151 | 153 | 'sys_path' : sys.path, |
152 | 154 | 'template_info': template_info, |
… |
… |
TECHNICAL_500_TEMPLATE = """
|
373 | 375 | <td>{{ sys_version_info }}</td> |
374 | 376 | </tr> |
375 | 377 | <tr> |
| 378 | <th>Server time:</th> |
| 379 | <td>{{server_time|date:"d.m.Y H:i:s"}}</td> |
| 380 | </tr> |
| 381 | <tr> |
376 | 382 | <th>Python Path:</th> |
377 | 383 | <td>{{ sys_path }}</td> |
378 | 384 | </tr> |