-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Force application to use file based email backend when specified in s…
…ettings (#354) * Force application to use file based email backend when specified in settings. * Update docs
- Loading branch information
1 parent
bb772e6
commit a188d0b
Showing
2 changed files
with
9 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -178,20 +178,18 @@ | |
|
||
# Email server | ||
|
||
if DEBUG: | ||
if _email_path := env.get_value('DEBUG_EMAIL_DIR', default=None): | ||
EMAIL_BACKEND = 'django.core.mail.backends.filebased.EmailBackend' | ||
EMAIL_FILE_PATH = _email_path | ||
|
||
else: | ||
EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend' | ||
|
||
EMAIL_FILE_PATH = env.path('DEBUG_EMAIL_DIR', BASE_DIR / 'email_files') | ||
|
||
EMAIL_HOST = env.str('EMAIL_HOST', 'localhost') | ||
EMAIL_PORT = env.int('EMAIL_PORT', 25) | ||
EMAIL_HOST_USER = env.str('EMAIL_HOST_USER', '') | ||
EMAIL_HOST_PASSWORD = env.str('your_email_password', '') | ||
EMAIL_USE_TLS = env.bool('EMAIL_USE_TLS', False) | ||
EMAIL_FROM_ADDRESS = env.str('EMAIL_FROM_ADDRESS', '[email protected]') | ||
EMAIL_HOST = env.str('EMAIL_HOST', 'localhost') | ||
EMAIL_PORT = env.int('EMAIL_PORT', 25) | ||
EMAIL_HOST_USER = env.str('EMAIL_HOST_USER', '') | ||
EMAIL_HOST_PASSWORD = env.str('your_email_password', '') | ||
EMAIL_USE_TLS = env.bool('EMAIL_USE_TLS', False) | ||
EMAIL_FROM_ADDRESS = env.str('EMAIL_FROM_ADDRESS', '[email protected]') | ||
|
||
# Database | ||
|
||
|