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, and sessionid 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, in urls.py of your project.

Note

Requires Django 1.4+.

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 TEMPLATE_URL_RESOLVERS_DEBUG to True to normally raise an exception. Only active when TEMPLATE_DEBUG is set to True as well.