-
Notifications
You must be signed in to change notification settings - Fork 53
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added a parameter to list administrators who will receive 500 errors
- Loading branch information
1 parent
de1b239
commit d41c1df
Showing
3 changed files
with
26 additions
and
0 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 |
---|---|---|
|
@@ -280,6 +280,11 @@ | |
'class': 'logging.StreamHandler', | ||
'formatter': 'verbose', | ||
}, | ||
"mail_admins": { | ||
"level": "ERROR", | ||
"class": "django.utils.log.AdminEmailHandler", | ||
"include_html": True, | ||
}, | ||
}, | ||
'loggers': { | ||
'': { | ||
|
@@ -311,15 +316,18 @@ | |
# ----------------------------------------- | ||
# Squest email config | ||
# ----------------------------------------- | ||
ADMINS = [("", element) for element in os.environ.get('SQUEST_ADMINS', '').split(',') if element] | ||
SQUEST_HOST = os.environ.get('SQUEST_HOST', "http://squest.domain.local") | ||
SQUEST_EMAIL_HOST = os.environ.get('SQUEST_EMAIL_HOST', "[email protected]") | ||
SERVER_EMAIL = SQUEST_EMAIL_HOST | ||
SQUEST_EMAIL_NOTIFICATION_ENABLED = str_to_bool(os.environ.get('SQUEST_EMAIL_NOTIFICATION_ENABLED', False)) | ||
EMAIL_HOST = os.environ.get('EMAIL_HOST', 'localhost') | ||
EMAIL_PORT = os.environ.get('EMAIL_PORT', 25) | ||
EMAIL_HOST_USER= os.environ.get('EMAIL_HOST_USER', None) | ||
EMAIL_HOST_PASSWORD= os.environ.get('EMAIL_HOST_PASSWORD', None) | ||
EMAIL_USE_SSL= os.environ.get('EMAIL_USE_SSL', False) | ||
|
||
print(f"ADMINS: {ADMINS}") | ||
print(f"SQUEST_HOST: {SQUEST_HOST}") | ||
print(f"SQUEST_EMAIL_HOST: {SQUEST_EMAIL_HOST}") | ||
print(f"SQUEST_EMAIL_NOTIFICATION_ENABLED: {SQUEST_EMAIL_NOTIFICATION_ENABLED}") | ||
|
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 |
---|---|---|
|
@@ -185,6 +185,17 @@ Address of the Squest portal instance. Used in email templates and in metadata s | |
|
||
Domain name used as email sender. E.g: "[email protected]". | ||
|
||
### SQUEST_ADMINS | ||
|
||
**Default:** `''` | ||
|
||
A list of all the email who get code error notifications. When DEBUG=False. | ||
Example: | ||
|
||
```text | ||
[email protected],[email protected] | ||
``` | ||
|
||
### SQUEST_EMAIL_NOTIFICATION_ENABLED | ||
|
||
**Default:** Based on `DEBUG` value by default | ||
|