1024programmer Java Djangoerror information email notification function configuration deployment

Djangoerror information email notification function configuration deployment

1. Recently, QA has become the focus of the project. In addition to breaking through the resistance of relying on external tables and starting to enable unit testing, another point is to enable error messages for online production services. Here’s a brief explanation of how to enable this email notification function:

1. Sending email account configuration configuration:

  1. EMAIL_HOST = ‘smtp.smthserver.com’
  2. EMAIL_PORT = ’25’
  3. EMAIL_HOST_USER = [email protected]
  4. EMAIL_HOST_PASSWORD = ‘mailpassword’

2. ADMINS configuration:

  1. ADMINS = [(‘John’, [email protected]’), ( ‘Mary’, [email protected]’)]

3. SERVER_EMAIL configuration

  1. SERVER_EMAIL = [email protected]

4. If you have customized logging configuration, you need to add a mail handler to the logging and add it to the handlers list of the error information.

5. Sensitive variable information shielding. For view-level sensitive information shielding, use the decorator @sensitive_variables. For global customization of ExceptionReporterFilter, I took a look at the implementation of the system’s default SafeExceptionReporterFilter. The simplest custom implementation method is to rewrite that reporter template.

This article is from the internet and does not represent1024programmerPosition, please indicate the source when reprinting:https://www.1024programmer.com/724852

author: admin

Previous article
Next article

Leave a Reply

Your email address will not be published. Required fields are marked *

Contact Us

Contact us


Online consultation: QQ交谈

E-mail: [email protected]

Working hours: Monday to Friday, 9:00-17:30, holidays off

Follow wechat
Scan wechat and follow us

Scan wechat and follow us

Follow Weibo
Back to top