1
0
mirror of https://github.com/netbox-community/netbox.git synced 2024-05-10 07:54:54 +00:00

Closes #4991: Add Python and NetBox versions to error page

This commit is contained in:
Jeremy Stretch
2020-08-21 12:58:48 -04:00
parent e02590ac96
commit 802af06c0f
3 changed files with 16 additions and 1 deletions

View File

@@ -1,8 +1,10 @@
import logging
import platform
import re
import sys
from copy import deepcopy
from django.conf import settings
from django.contrib import messages
from django.contrib.auth.decorators import login_required
from django.contrib.contenttypes.models import ContentType
@@ -1421,6 +1423,8 @@ def server_error(request, template_name=ERROR_500_TEMPLATE_NAME):
type_, error, traceback = sys.exc_info()
return HttpResponseServerError(template.render({
'python_version': platform.python_version(),
'netbox_version': settings.VERSION,
'exception': str(type_),
'error': error,
}))