Skip to content

Use env variables to set SMTP settings #222

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions oshc/oshc/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -159,11 +159,12 @@

STATICFILES_DIRS = (os.path.join(BASE_DIR, 'main/'), )

EMAIL_HOST = 'smtp.gmail.com'
EMAIL_HOST_USER = 'email'
EMAIL_HOST_PASSWORD = 'password'
EMAIL_PORT = 587
EMAIL_HOST = os.getenv('EMAIL_HOST', '')
EMAIL_HOST_USER = os.getenv('EMAIL_ID', '')
EMAIL_HOST_PASSWORD = os.getenv('EMAIL_PASSWORD', '')
EMAIL_PORT = os.getenv('EMAIL_PORT', '')
EMAIL_USE_TLS = True

Copy link
Member

@tapaswenipathak tapaswenipathak Jan 6, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Register/Login is of no good use if we don't confirm the email. Currently we have it hidden on master, once we are up with check we would make it live. This is needed and cannot be removed. Did you get the chance to set it on Heroku? or does this not work for you? looks good.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@tapasweni-pathak There is a known issue with Gmail and Heroku. Heroku servers are located all around the world. When we try to send an email via Heroku server, Gmail blocks the request considering the unusual origin of the request. We could try and see if this works, but I'm not sure if this email verification via emails from gmail should be used on production.

Copy link
Member

@tapaswenipathak tapaswenipathak Jan 13, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This happens with mutt too if you use it with Gmail, this needs to be set up in that case and we can restrict to heroku. Can you please drop a blog or something, as I'm aware about this but not about the known issue, thanks!

LOGIN_REDIRECT_URL = "/"

CRISPY_TEMPLATE_PACK = 'bootstrap3'