Skip to content

Django Email Configuration

Django is a Python-based web framework that allows more control for sending emails using functions and expressions.

settings.py
EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend'
EMAIL_HOST = 'smtp.gmail.com'
EMAIL_USE_TLS = True
EMAIL_PORT = 587
EMAIL_HOST_USER = #sender's email-id
EMAIL_HOST_PASSWORD = #password associated with above email-id

Less Secure apps gmail

  1. Go to myaccount.google.com
  2. Go to security, ande enable 2FA
  3. If the App Password is not shown inside the 2FA, then
  4. Search App Password in the search bar
  5. Select the App Password and created a new app password.
  6. Finally you can see the App Password visible inside the Security.

Reference