From 266b9ffe425cf5f71d77e22bd26ee09b8b9cf6b6 Mon Sep 17 00:00:00 2001 From: Sarah Withee <2601974+geekygirlsarah@users.noreply.github.com> Date: Mon, 9 Oct 2023 19:04:32 -0400 Subject: [PATCH] Set environment variables for error reporting --- codethesaurus/settings.py | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/codethesaurus/settings.py b/codethesaurus/settings.py index ab498e543..ac79008c1 100644 --- a/codethesaurus/settings.py +++ b/codethesaurus/settings.py @@ -55,7 +55,8 @@ 'django.middleware.csrf.CsrfViewMiddleware', 'django.contrib.auth.middleware.AuthenticationMiddleware', 'django.contrib.messages.middleware.MessageMiddleware', - 'django.middleware.clickjacking.XFrameOptionsMiddleware' + 'django.middleware.clickjacking.XFrameOptionsMiddleware', + 'django.middleware.common.BrokenLinkEmailsMiddleware' ] ROOT_URLCONF = 'codethesaurus.urls' @@ -147,5 +148,15 @@ os.path.join(BASE_DIR, 'static'), ] +# For server error reporting +ADMINS = os.getenv('ADMINS', '') +EMAIL_HOST = os.getenv('EMAIL_HOST', '') +EMAIL_HOST_USER = os.getenv('EMAIL_HOST_USER', '') +EMAIL_HOST_PASSWORD = os.getenv('EMAIL_HOST_PASSWORD', '') +SERVER_EMAIL = os.getenv('SERVER_EMAIL', '') +EMAIL_USE_SSL = os.getenv('EMAIL_USE_SSL', '') +EMAIL_PORT = os.getenv('EMAIL_PORT', '') +EMAIL_USE_TLS = os.getenv('EMAIL_USE_TLS', '') + # Configure Django App for Heroku. django_on_heroku.settings(locals(), test_runner=False, databases=False, staticfiles=True, logging=True)