Skip to content
Snippets Groups Projects
Verified Commit 83d6c04d authored by Tanner Prestegard's avatar Tanner Prestegard
Browse files

Get email credentials from environment for containerized deployment

parent 9bc8a205
No related branches found
No related tags found
No related merge requests found
......@@ -56,6 +56,13 @@ TWILIO_AUTH_TOKEN = os.environ.get('DJANGO_TWILIO_AUTH_TOKEN', None)
if TWILIO_AUTH_TOKEN is None:
raise ImproperlyConfigured('Could not get Twilio auth token from envvars.')
# Get email settings from environment
EMAIL_PORT = 587
EMAIL_USE_TLS = True
EMAIL_HOST = os.environ.get('SMTP_HOST', 'localhost')
EMAIL_HOST_USER = os.environ.get('SMTP_USERNAME', '')
EMAIL_HOST_PASSWORD = os.environ.get('SMTP_PASSWORD', '')
# Database settings -----------------------------------------------------------
DATABASES = {
'default' : {
......@@ -98,7 +105,6 @@ if hosts_from_env is not None:
ALLOWED_HOSTS += [SERVER_FQDN]
# Email settings - dependent on server hostname and FQDN ----------------------
EMAIL_HOST = 'localhost'
SERVER_EMAIL = 'GraceDB <gracedb@{fqdn}>'.format(fqdn=SERVER_FQDN)
ALERT_EMAIL_FROM = SERVER_EMAIL
ALERT_EMAIL_TO = []
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment