diff --git a/django/views/debug.py b/django/views/debug.py index 30a1dbc6da..b93afa5737 100644 --- a/django/views/debug.py +++ b/django/views/debug.py @@ -396,6 +396,8 @@ class ExceptionReporter: c["exception_type"] = self.exc_type.__name__ if self.exc_value: c["exception_value"] = str(self.exc_value) + if exc_notes := getattr(self.exc_value, "__notes__", None): + c["exception_notes"] = "\n" + "\n".join(exc_notes) if frames: c["lastframe"] = frames[-1] return c diff --git a/django/views/templates/technical_500.html b/django/views/templates/technical_500.html index 4483145ec3..ae0411729a 100644 --- a/django/views/templates/technical_500.html +++ b/django/views/templates/technical_500.html @@ -100,7 +100,7 @@
{% if exception_value %}{{ exception_value|force_escape }}{% else %}No exception message supplied{% endif %}+
{% if exception_value %}{{ exception_value|force_escape }}{% if exception_notes %}{{ exception_notes }}{% endif %}{% else %}No exception message supplied{% endif %}