Switch to specifying an SSL flavor

- This helps to ensure that only one is ever set
- But also, because of the way the values are passed in, it's always
  going to be evaluated as a string, which is always True. So we can't
  just pass in a bool directly
This commit is contained in:
James Polley 2018-07-02 03:28:57 +10:00
parent 11f4a05011
commit 3f7773c687

View file

@ -39,8 +39,13 @@ 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)
DEFAULT_FROM_EMAIL = os.environ.get('DEFAULT_FROM_EMAIL', 'webmaster@localhost')
EMAIL_USE_TLS = os.environ.get('EMAIL_USE_TLS', True)
EMAIL_USE_SSL = os.environ.get('EMAIL_USE_SSL', False)
EMAIL_USE_SSL = False
EMAIL_USE_TLS = False
_EMAIL_SSL_FLAVOR=os.environ.get('EMAIL_SSL_FLAVOR', None)
if _EMAIL_SSL_FLAVOR == "TLS":
EMAIL_USE_TLS = True
elif _EMAIL_SSL_FLAVOR == "SSL":
EMAIL_USE_SSL = True
SECRET_KEY = os.environ.get('DJANGO_SECRET_KEY', None)