Задать вопрос

Тел: +7 965 3737 888

464

Просмотров

3

Ответов

More informative error mailings

<p>This middleware makes the admin error emails a lot more informative: you get the same HTML response that you get with DEBUG=True.</p>
<p>It uses the base class defined in <a href="http://foothold.ru/knowledge/detail/extensible-exception-handling-middleware.html">#638</a>.</p>
<p>You will probably want to apply the patch for <a href="http://code.djangoproject.com/ticket/6748">#6748</a> to help avoid slowdowns caused by unintentional database queries. As the ticket (and django-developers thread) notes, it isn't foolproof; you may still find this executing database queries.</p>

Вопрос полезен? Да0/Нет0
file_4992.py(818.0б)
None

Ответы (3):

Ответhenrikg:12.08.2008
Ответ полезен? Да0/Нет0

Would it be possible to send the "debug_response.content" as an attachment in the mail, instead of as part of the message?

Ответhenrikg:12.08.2008
Ответ полезен? Да0/Нет0

Howto use this middleware in your own project:

1. Download snippets 631 (this page) and 638.

2. Change the import line in the top of 631, so that 638 will be found, for example:

from myproject.middleware.638 import StandardExceptionMiddleware...

3. Add the middleware to myproject/settings.py:

MIDDLEWARE_CLASSES = ( myproject.middleware.631.HTMLMailExceptionMiddleware ... )

Ответkcarnold:18.06.2008
Ответ полезен? Да0/Нет0

Ignore the above comment; the snippet has been changed to reflect that.