-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: Update email settings in settings_env.py for logging purposes
- Loading branch information
1 parent
15f68fe
commit 299d1e3
Showing
2 changed files
with
18 additions
and
1 deletion.
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 |
---|---|---|
|
@@ -17,6 +17,10 @@ def configure_settings(): | |
hosts = [ os.environ.get("TOOLNAME") + '.toolforge.org', 'toolforge.org' ] | ||
callback = 'https://' + os.environ.get("TOOLNAME") + '.toolforge.org/oauth/complete/mediawiki/' | ||
message = 'You are running in production mode' | ||
email_host = 'mail.tools.wmflabs.org' | ||
email_port = 587 | ||
server_email = os.environ.get("TOOLNAME") + '@tools.wmflabs.org' | ||
admins = [('Admin', '[email protected]')] | ||
|
||
databases = { | ||
'default': { | ||
|
@@ -42,6 +46,10 @@ def configure_settings(): | |
hosts = ['127.0.0.1'] | ||
callback = 'http://127.0.0.1:8000/oauth/complete/mediawiki/' | ||
message = 'You are running in local mode, please make sure to set up the replica.my.cnf file to run in production mode' | ||
email_host = 'localhost' | ||
email_port = 25 | ||
server_email = 'root@localhost' | ||
admins = [] | ||
|
||
databases = { | ||
'default': { | ||
|
@@ -56,11 +64,19 @@ def configure_settings(): | |
'SOCIAL_AUTH_MEDIAWIKI_CALLBACK': callback, | ||
'DATABASES': databases, | ||
'MESSAGE': message, | ||
'EMAIL_HOST': email_host, | ||
'EMAIL_PORT': email_port, | ||
'SERVER_EMAIL': server_email, | ||
'ADMINS': admins | ||
} | ||
|
||
settings = configure_settings() | ||
DEBUG = settings['DEBUG'] | ||
ALLOWED_HOSTS = settings['ALLOWED_HOSTS'] | ||
SOCIAL_AUTH_MEDIAWIKI_CALLBACK = settings['SOCIAL_AUTH_MEDIAWIKI_CALLBACK'] | ||
DATABASES = settings['DATABASES'] | ||
EMAIL_HOST = settings['EMAIL_HOST'] | ||
EMAIL_PORT = settings['EMAIL_PORT'] | ||
SERVER_EMAIL = settings['SERVER_EMAIL'] | ||
ADMINS = settings['ADMINS'] | ||
print(settings['MESSAGE']) |