Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Send email on web exception #512

Merged
merged 3 commits into from
Nov 9, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion wastd/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@
"wamtram", # Legacy WAMTRAM database
#"tagging", # Temporary turtle tagging data
"turtle_tags",
#"marine_mammal_incidents"
]
MIDDLEWARE = [
"wastd.middleware.HealthCheckMiddleware",
Expand Down Expand Up @@ -251,8 +252,10 @@
EMAIL_HOST = os.environ.get("EMAIL_HOST", "email.host")
EMAIL_PORT = os.environ.get("EMAIL_PORT", 25)
DEFAULT_FROM_EMAIL = os.environ.get("DEFAULT_FROM_EMAIL", "[email protected]")
SERVER_EMAIL = DEFAULT_FROM_EMAIL
EMAIL_SUBJECT_PREFIX = os.environ.get("EMAIL_SUBJECT_PREFIX", "[Turtles DB] ")
ADMIN_EMAILS = os.environ.get("ADMIN_EMAILS", "").split(",")
ADMINS =[("Admin",os.environ.get("ADMIN_EMAILS", ""))]


# Static files (CSS, JavaScript, Images)
Expand Down Expand Up @@ -281,6 +284,11 @@
"stream": sys.stdout,
"level": "WARNING",
},
"mail_admins": {
"level": "ERROR",
"class": "django.utils.log.AdminEmailHandler",
"formatter": "verbose",
},
"turtles": {
"class": "logging.StreamHandler",
"formatter": "verbose",
Expand All @@ -290,7 +298,7 @@
},
"loggers": {
"django": {
"handlers": ["console"],
"handlers": ["console","mail_admins"],
"level": "ERROR",
},
"turtles": {
Expand Down
Loading