About Testing Emails
You can test the outgoing emails by setting EMAIL_BACKEND = "django.core.mail.backends.locmem.EmailBackend"
in the settings and then using the django.core.mail
module, as follows:
from django.core import mail
email = mail.outbox[0]
from_email = email.from_email
to_emails = email.to
subject = email.subject
plain_text_message = email.body
html_message, mime_type = email.alternatives[0]
Tips and Tricks Programming Testing Django 5.x Django 4.2 Django 3.2 Django 2.2
Also by me
Django Paddle Subscriptions app
For Django-based SaaS projects.
Django GDPR Cookie Consent app
For Django websites that use cookies.