Skip to content

Commit

Permalink
Merge pull request #512 from ehallein/master
Browse files Browse the repository at this point in the history
Send email on web exception
  • Loading branch information
ehallein authored Nov 9, 2023
2 parents 8938cfb + 6c04dfc commit 68da03b
Showing 1 changed file with 9 additions and 1 deletion.
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

0 comments on commit 68da03b

Please sign in to comment.