Skip to content

Commit ef8a77f

Browse files
committed
Enable configuring email backend via environment
1 parent 72cafaf commit ef8a77f

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

app/app/settings.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -296,12 +296,12 @@
296296
'endpoint': env('AZURE_APPINSIGHTS_ENDPOINT', None),
297297
}
298298

299-
## necessary for email verification setup
300-
# EMAIL_USE_TLS = True
301-
# EMAIL_HOST = 'smtp.gmail.com'
302-
# EMAIL_HOST_USER = '[email protected]'
303-
# EMAIL_HOST_PASSWORD = 'gfds6jk#4ljIr%G8%'
304-
# EMAIL_PORT = 587
305-
#
306-
## During development only
307-
# EMAIL_BACKEND = 'django.core.mail.backends.console.EmailBackend'
299+
# necessary for email verification of new accounts
300+
EMAIL_USE_TLS = env.bool('EMAIL_USE_TLS', False)
301+
EMAIL_HOST = env('EMAIL_HOST', None)
302+
EMAIL_HOST_USER = env('EMAIL_HOST_USER', None)
303+
EMAIL_HOST_PASSWORD = env('EMAIL_HOST_PASSWORD', None)
304+
EMAIL_PORT = env.int('EMAIL_PORT', 587)
305+
306+
if not EMAIL_HOST:
307+
EMAIL_BACKEND = 'django.core.mail.backends.console.EmailBackend'

0 commit comments

Comments
 (0)