Skip to content

Commit

Permalink
feat: add email error handler
Browse files Browse the repository at this point in the history
  • Loading branch information
trowik committed Jan 3, 2023
1 parent a4e8997 commit 67c8383
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions document_merge_service/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -235,9 +235,22 @@ def parse_admins(admins):
"level": "WARNING",
"filters": None,
"class": "logging.StreamHandler",
}
},
"mail_admins": {
"level": "ERROR",
"filters": None,
"class": "django.utils.log.AdminEmailHandler",
},
},
"loggers": {"django": {"handlers": ["console"], "level": "WARNING"}},
"loggers": {"django": {"handlers": ["console", "mail_admins"], "level": "WARNING"}},
}

URL_PREFIX = env.str("URL_PREFIX", default="")

# Email settings
SERVER_MAIL = env.str("SERVER_MAIL", default="root@localhost")
EMAIL_HOST = env.str("EMAIL_HOST", default="localhost")
EMAIL_PORT = env.int("EMAIL_PORT", default=25)
EMAIL_HOST_USER = env.str("EMAIL_HOST_USER", default="")
EMAIL_HOST_PASSWORD = env.str("EMAIL_HOST_PASSWORD", default="")
EMAIL_USE_TLS = env.bool("EMAIL_USE_TLS", default=False)

0 comments on commit 67c8383

Please sign in to comment.