In this chapter, we gave Mail Ape the ability to send emails to our users'MailingList
's confirmed Subscribers
. We also learned how to use Celery to process tasks outside of Django's request/response cycle. This lets us process tasks that may take a long time or require other resources (for example, SMTP servers and more memory) without slowing down our Django web servers.
We covered a variety of email and Celery-related topics in this chapter. We saw how to configure Django to use an SMTP server. We used Django's send_email()
function to send emails. We created a Celery task with the @shared_task
decorator. We queued a Celery task using its delay()
method. Finally, we explored some useful approaches for testing code that relies on external resources.
Next, let's build an API for our Mail Ape so that our users can integrate into their own websites and apps.