From 19de058f9456f615be4d2d652a30c736a942d9dd Mon Sep 17 00:00:00 2001 From: Jeremy Stretch Date: Mon, 5 Jan 2026 16:09:39 -0500 Subject: [PATCH] Closes #21071: Include the request method & URL when displaying a server error --- netbox/netbox/views/errors.py | 1 + netbox/templates/500.html | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/netbox/netbox/views/errors.py b/netbox/netbox/views/errors.py index 5872a59cd..0ae0dc8f4 100644 --- a/netbox/netbox/views/errors.py +++ b/netbox/netbox/views/errors.py @@ -52,6 +52,7 @@ def handler_500(request, template_name=ERROR_500_TEMPLATE_NAME): type_, error = sys.exc_info()[:2] return HttpResponseServerError(template.render({ + 'request': request, 'error': error, 'exception': str(type_), 'netbox_version': settings.RELEASE.full_version, diff --git a/netbox/templates/500.html b/netbox/templates/500.html index 7dd1acd04..5df3f6ec2 100644 --- a/netbox/templates/500.html +++ b/netbox/templates/500.html @@ -35,6 +35,12 @@ {% trans "Plugins" %}: {% for plugin, version in plugins.items %} {{ plugin }}: {{ version }}{% empty %}{% trans "None installed" %}{% endfor %} +

+ {% trans "The request which yielded the above error is shown below:" %} +

+

+ {{ request.method }} {{ request.build_absolute_uri }} +

{% trans "If further assistance is required, please post to the" %} {% trans "NetBox discussion forum" %} {% trans "on GitHub" %}.