Opened 4 years ago

Closed 4 years ago

Last modified 3 years ago

#32105 closed New feature (fixed)

Allow overriding technical 500 page templates

Reported by: Aarni Koskela Owned by: Aarni Koskela
Component: Error reporting Version: dev
Severity: Normal Keywords:
Cc: Triage Stage: Ready for checkin
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

When specifying a custom DEFAULT_EXCEPTION_REPORTER class, the template paths aren't easily overrideable since they're formed as local variables within the rendering functions (see https://github.com/django/django/blob/78ae8cc5d8aff65afbf35947421a8a1aba13bfab/django/views/debug.py#L334); as it is, one has to copy-paste the functions into a subclass.

Hoisting them up to class-level variables would make deriving from the default ExceptionReporter more effortless.

Change History (8)

comment:1 by Aarni Koskela, 4 years ago

Owner: set to Aarni Koskela
Status: newassigned

I have a patch for this, will rebase and clean up (https://github.com/django/django/pull/12393).

comment:3 by Carlton Gibson, 4 years ago

Needs documentation: set
Triage Stage: UnreviewedAccepted

Yep, seems reasonable. The new attributes will need docs and release notes.

comment:4 by Nick Pope, 4 years ago

Needs documentation: unset

comment:5 by Carlton Gibson, 4 years ago

Triage Stage: AcceptedReady for checkin

comment:6 by Carlton Gibson <carlton@…>, 4 years ago

Resolution: fixed
Status: assignedclosed

In 68e33b3:

Fixed #32105 -- Added template paths as ExceptionReporter class attributes.

This allows replacement of the debugging templates without having to
copy-paste the get_traceback_html and get_traceback_text functions
into a subclass.

Thanks to Nick Pope for review.

comment:7 by Mariusz Felisiak <felisiak.mariusz@…>, 3 years ago

In 7248afe1:

Refs #32105 -- Moved ExceptionReporter template paths to properties.

Refs #32316.

comment:8 by Mariusz Felisiak <felisiak.mariusz@…>, 3 years ago

In a118564a:

[3.2.x] Refs #32105 -- Moved ExceptionReporter template paths to properties.

Refs #32316.

Backport of 7248afe12f40361870388ecdd7e0038eb0d58e47 from main

Note: See TracTickets for help on using tickets.
Back to Top