Debugging¶
Safer ExceptionReporterFilter¶
-
class
missing.debug.
SafeExceptionReporterFilter
¶ Safe exception reporter filter which also filters request environment (
META
) and cookies (COOKIES
) so that it is safer to share the report publicly.This is useful to not display passwords and other sensitive data passed to Django through its process environment.
Furthermore, it configures Django to additionally clean settings with
URL
,CSRF
,COOKIE
,csrftoken
,csrfmiddlewaretoken
, andsessionid
in keys.To install it, configure Django to:
DEFAULT_EXCEPTION_REPORTER_FILTER = 'missing.debug.SafeExceptionReporterFilter'
and import
missing.debug
somewhere in your code, for example, inurls.py
of your project.
Non-silent NoReverseMatch¶
NoReverseMatch
is by default a silent exception in variables, its output replaced by TEMPLATE_STRING_IF_INVALID
setting. Sometimes you want a bit more loud expression of mismatched URL reversing, so you can set
URL_RESOLVERS_DEBUG
to True
to normally raise an exception. Only active when DEBUG
is set
to True
as well.