After a user signs up, send an email using a worker instance that receives messages from RabbitMQ
It takes a lot of time to send emails during the request/response cycle, so I'm using RabbitMQ
to publish a task and receive the task using a worker instance. Using this method, the client will not wait for SMTP to complete.
- Make sure you have RabbitMQ running on localhost(or change the
host
inconsumer.py
andproducer.py
) - Install requirements.
pip install requirements.txt
- Rename
.env.sample
file to.env
and fill the required variables with proper data. - Run django app.
python manage.py runserver
- Run worker instance(consumer).
python consumer.py