request = None
request_repr = 'unavailable'
subject = self.format_subject(subject)
if record.exc_info:
    exc_info = record.exc_info
else:
    exc_info = None, record.getMessage(), None
message = """%s

Request repr(): %s""" % (self.format(record), request_repr)
reporter = ExceptionReporter(request, is_email=True, *exc_info)
html_message = reporter.get_traceback_html() if self.include_html else None
try:
    mail.mail_admins(subject, message, fail_silently=True, html_message=
        html_message, connection=self.connection())
except Exception as e:
    console_logger.warn('%s : %s' % (__name__, str(e)))
Отправьте тело почтового запроса администратору Django во время ошибки сервера.