diff options
| author | Aarni Koskela <akx@iki.fi> | 2020-10-15 11:44:02 +0200 |
|---|---|---|
| committer | Carlton Gibson <carlton@noumenal.es> | 2020-10-15 13:56:15 +0200 |
| commit | 68e33b347d5684214783ac65c5b4f0598f35c0f6 (patch) | |
| tree | 69e1c590ef271abbdfb322409bf779b20b1bcbe8 /docs | |
| parent | 411cc0ae18aa9c64447eed229e65e092d23f80e6 (diff) | |
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.
Diffstat (limited to 'docs')
| -rw-r--r-- | docs/howto/error-reporting.txt | 16 | ||||
| -rw-r--r-- | docs/releases/3.2.txt | 5 |
2 files changed, 20 insertions, 1 deletions
diff --git a/docs/howto/error-reporting.txt b/docs/howto/error-reporting.txt index c77f1e955e..e2dbe7ca27 100644 --- a/docs/howto/error-reporting.txt +++ b/docs/howto/error-reporting.txt @@ -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. diff --git a/docs/releases/3.2.txt b/docs/releases/3.2.txt index 0c233f796b..d61f66733d 100644 --- a/docs/releases/3.2.txt +++ b/docs/releases/3.2.txt @@ -188,7 +188,10 @@ Email Error Reporting ~~~~~~~~~~~~~~~ -* ... +* Custom :class:`~django.views.debug.ExceptionReporter` subclasses can now set + the :attr:`~django.views.debug.ExceptionReporter.html_template_path` and + :attr:`~django.views.debug.ExceptionReporter.text_template_path` class + attributes to override the templates used to render exception reports. File Storage ~~~~~~~~~~~~ |
