How can I make a Django `locals ()` error message?

When your Django application throws an exception, Django sends you an error message that contains some useful information. It's great. But there is one piece of information that would be useful for debugging, but missing from these emails: locals() .

How can I do Django include locals() email messages?

+4
source share
2 answers

Allowed it by including 'include_html': 'True', next to 'class': 'django.utils.log.AdminEmailHandler', in the LOGGING setting in settings.py . Now I get HTML reports via email that contain all the locals() .

+3
source

According to the documentation, Django includes local residents. Or am I missing something? You can also find in the document (see Link above) how to write your own error reports.

0
source

Source: https://habr.com/ru/post/1411982/


All Articles