Date: Fri, 29 Mar 2024 09:59:24 -0400 (EDT) Message-ID: <73681323.983.1711720764113@ip-10-208-26-37.ec2.internal> Subject: Exported From Confluence MIME-Version: 1.0 Content-Type: multipart/related; boundary="----=_Part_982_1025889854.1711720764111" ------=_Part_982_1025889854.1711720764111 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Content-Location: file:///C:/exported.html
The CodaLab website requires the ability to send emails when a user forg= ets his or her password and requests a password reset.
We use the "SendGrid add-on to Windows Azure" to send emails via SMTP.= p>
The SendGrid developer documentation explains how to integrate the email service in Django= a>. In addition, the Django project provides comprehensive documentation:&n= bsp;https://docs.djangoproject.com/en/dev/top= ics/email/. Additional notes are collected below.
The key settings that affect how emailing works follow.
EMAIL_B= ACKEND =3D 'django.core.mail.backends.smtp.EmailBackend' EMAIL_HOST =3D 'smtp.sendgrid.net' EMAIL_HOST_USER =3D '<insert username>' EMAIL_HOST_PASSWORD =3D '<insert password>' EMAIL_PORT =3D 587 EMAIL_USE_TLS =3D True DEFAULT_FROM_EMAIL =3D 'info@codalab.org' SERVER_EMAIL =3D 'info@codalab.org'
The Site configuration also plays a role because it defines the = domain name associated with the website. The site domain name and a human-r= eadable name of the website are defined in the settings by:
CODALAB_SITE_DOMAIN =3D 'codalab.org'
CODALAB_SITE_NAME =3D 'CodaLab'
The initialize.py
script inserts these names in t=
he database. Recall that initialize.py
is located in=
codalab/scripts
and is used to insert constants int=
o the database. To illustrate how the site info is used, consider the email=
sent to a user resetting his or her password:
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 pas= sword=20 for your user account at codalab.org. It can be safely ignored if you did n= ot request=20 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!
The subject field of the email uses the verbose name of the site, while =
the body of the email includes several references to codalab.org,
which is given by the site'=
s domain name.
As noted in the Django documentation<= /a>, one can avoid sending emails during development but still see them in = the console by setting:
EMAIL_BACKEND =3D 'django.core.mail.backends.console.EmailBacken=
d'
This is the default configuration for the base Dev
&nbs=
p;configuration.