Page History
The CodaLab web site website requires the ability to send emails when a user forgets his or her password and requests a password reset.
We use the "SendGrid add-on to Windows Azure" to send emails via SMTP.
The SendGrid developer 's documentation explains how to integrate the email service in Django. In addition, the Django project provides comprehensive documentation: https://docs.djangoproject.com/en/dev/topics/email/. Additional notes are collected below.
Settings
The key settings which that affect how emailing works are:follow.
Code Block |
---|
EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend' EMAIL_HOST = 'smtp.sendgrid.net' EMAIL_HOST_USER = '<insert username>' EMAIL_HOST_PASSWORD = '<insert password>' EMAIL_PORT = 587 EMAIL_USE_TLS = True DEFAULT_FROM_EMAIL = 'info@codalab.org' SERVER_EMAIL = 'info@codalab.org' |
...
The initialize.py
script inserts these names in the database. Recall that initialize.py
is located in codalab/scripts
and is used to insert constants into the database. To illustrate how the site info is used, consider the email sent to a user resetting his or her password:
Code Block |
---|
Subject: [CodaLab] Password Reset Email From: info@codalab.org To: someuser@somewhere.com Date: Thu, 03 Oct 2013 22:42:55 -0000 You're receiving this email because you or someone else has requested a password for your user account at codalab.org. It can be safely ignored if you did not request a password reset. Click the link below to reset your password. http://codalab.org/accounts/password/reset/key/1-3le-6640241efe4e5b77f4e5/ In case you forgot, your username is someuser. Thanks for using our site! |
...