mirror of
https://github.com/django/django.git
synced 2024-12-23 01:25:58 +00:00
Refs #32105 -- Moved ExceptionReporter template paths to properties.
Refs #32316.
This commit is contained in:
parent
db5b75f10f
commit
7248afe12f
@ -245,8 +245,14 @@ class SafeExceptionReporterFilter:
|
|||||||
|
|
||||||
class ExceptionReporter:
|
class ExceptionReporter:
|
||||||
"""Organize and coordinate reporting on exceptions."""
|
"""Organize and coordinate reporting on exceptions."""
|
||||||
html_template_path = CURRENT_DIR / 'templates' / 'technical_500.html'
|
|
||||||
text_template_path = CURRENT_DIR / 'templates' / 'technical_500.txt'
|
@property
|
||||||
|
def html_template_path(self):
|
||||||
|
return CURRENT_DIR / 'templates' / 'technical_500.html'
|
||||||
|
|
||||||
|
@property
|
||||||
|
def text_template_path(self):
|
||||||
|
return CURRENT_DIR / 'templates' / 'technical_500.txt'
|
||||||
|
|
||||||
def __init__(self, request, exc_type, exc_value, tb, is_email=False):
|
def __init__(self, request, exc_type, exc_value, tb, is_email=False):
|
||||||
self.request = request
|
self.request = request
|
||||||
|
@ -323,17 +323,18 @@ Your custom reporter class needs to inherit from
|
|||||||
|
|
||||||
.. versionadded:: 3.2
|
.. versionadded:: 3.2
|
||||||
|
|
||||||
A :class:`pathlib.Path` representing the absolute filesystem path to a
|
Property that returns a :class:`pathlib.Path` representing the absolute
|
||||||
template for rendering the HTML representation of the exception.
|
filesystem path to a template for rendering the HTML representation of
|
||||||
Defaults to the Django provided template.
|
the exception. Defaults to the Django provided template.
|
||||||
|
|
||||||
.. attribute:: text_template_path
|
.. attribute:: text_template_path
|
||||||
|
|
||||||
.. versionadded:: 3.2
|
.. versionadded:: 3.2
|
||||||
|
|
||||||
A :class:`pathlib.Path` representing the absolute filesystem path to a
|
Property that returns a :class:`pathlib.Path` representing the absolute
|
||||||
template for rendering the plain-text representation of the exception.
|
filesystem path to a template for rendering the plain-text
|
||||||
Defaults to the Django provided template.
|
representation of the exception. Defaults to the Django provided
|
||||||
|
template.
|
||||||
|
|
||||||
.. method:: get_traceback_data()
|
.. method:: get_traceback_data()
|
||||||
|
|
||||||
|
@ -299,10 +299,10 @@ Decorators
|
|||||||
Error Reporting
|
Error Reporting
|
||||||
~~~~~~~~~~~~~~~
|
~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
* Custom :class:`~django.views.debug.ExceptionReporter` subclasses can now set
|
* Custom :class:`~django.views.debug.ExceptionReporter` subclasses can now
|
||||||
the :attr:`~django.views.debug.ExceptionReporter.html_template_path` and
|
define the :attr:`~django.views.debug.ExceptionReporter.html_template_path`
|
||||||
:attr:`~django.views.debug.ExceptionReporter.text_template_path` class
|
and :attr:`~django.views.debug.ExceptionReporter.text_template_path`
|
||||||
attributes to override the templates used to render exception reports.
|
properties to override the templates used to render exception reports.
|
||||||
|
|
||||||
File Uploads
|
File Uploads
|
||||||
~~~~~~~~~~~~
|
~~~~~~~~~~~~
|
||||||
|
Loading…
Reference in New Issue
Block a user