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.
This commit is contained in:
Aarni Koskela 2020-10-15 11:44:02 +02:00 committed by Carlton Gibson
parent 411cc0ae18
commit 68e33b347d
7 changed files with 50 additions and 3 deletions

View file

@ -325,6 +325,22 @@ Your custom reporter class needs to inherit from
.. class:: ExceptionReporter
.. attribute:: html_template_path
.. versionadded:: 3.2
A :class:`pathlib.Path` representing the absolute filesystem path to a
template for rendering the HTML representation of the exception.
Defaults to the Django provided template.
.. attribute:: text_template_path
.. versionadded:: 3.2
A :class:`pathlib.Path` representing the absolute filesystem path to a
template for rendering the plain-text representation of the exception.
Defaults to the Django provided template.
.. method:: get_traceback_data()
Return a dictionary containing traceback information.