Getting detailed error reporting via e-mail
To perform system logging, Django uses Python's built-in logging module. The default Django configuration seems to be quite complex. In this recipe, you will learn how to tweak it in order to send error e-mails with complete HTML, similar to what is provided by Django in the DEBUG mode when an error happens.
Getting ready
Locate the Django project in your virtual environment.
How to do it...
The following procedure will help you send detailed e-mails about errors:
- Open the
myproject_env/lib/python2.7/site-packages/django/utils/log.py
file in a text editor and copy theDEFAULT_LOGGING
dictionary to your project's settings as theLOGGING
dictionary. - Add the
include_html
setting to themail_admins
handler, as ...
Get Web Development with Django Cookbook - Second Edition now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.