Skip to content

Commit

Permalink
Allow overriding SMTP settings in general.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
wfdd committed Jun 24, 2016
1 parent 9968d6b commit 81f3ed2
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
9 changes: 9 additions & 0 deletions conf/general.yml-example
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,15 @@ NGINX_SSL: false
# the repository).
MEDIA_ROOT: null

# This is the outgoing mail server's settings. You'll probably want to use
# a third-party mail server, e.g. Gmail's or your host's. Email is required for
# user-account activation, error reporting and image moderation.
EMAIL_HOST: ''
EMAIL_PORT: 465
EMAIL_HOST_USER: ''
EMAIL_HOST_PASSWORD: ''
EMAIL_USE_SSL: true

# Old settings required by mySociety Deploy system.
# These should now be edited at /settings in the YNR instance
SUPPORT_EMAIL: yournextmp-support@example.org
Expand Down
6 changes: 6 additions & 0 deletions mysite/settings/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,12 @@ def get_settings(conf_file_leafname, election_app=None, tests=False):
# SECURITY WARNING: keep the secret key used in production secret!
'SECRET_KEY': conf['SECRET_KEY'],

'EMAIL_HOST': conf.get('EMAIL_HOST'),
'EMAIL_PORT': conf.get('EMAIL_PORT'),
'EMAIL_HOST_USER': conf.get('EMAIL_HOST_USER'),
'EMAIL_HOST_PASSWORD': conf.get('EMAIL_HOST_PASSWORD'),
'EMAIL_USE_SSL': conf.get('EMAIL_USE_SSL'),

'TEMPLATE_DEBUG': True,
'TEMPLATE_DIRS': (
join(BASE_DIR, 'mysite', 'templates'),
Expand Down

0 comments on commit 81f3ed2

Please sign in to comment.