contact@digitalnotebooks.co
Stay Organized, Stay Inspired. Let's Write.

Bulk Email Tool 18: Handing the Task To Celery

Back To All Notes
  • Notebook: Django: Automating Common Tasks
  • Speaker: Udemy Instructor Rathan Kumar
  • Date Created: Aug. 19, 2024, 1:47 a.m.
  • Owner: Rosilie

Sending bulk emails will take awhile especially if its thousands or millions of email addresses. To resolve this, we use CELERY again just like how we used it in DATAENTRY to import or export large data.

1. In EMAILS folder, create a new file, TASKS.PY

2.  Update our EMAILS\VIEWS.PY to call the celery function in EMAILS\VIEWS.PY

3. Go to your CELERY BASH TERMINAL, press CTRL + C to stop it from running. Now execute the command to reload CeleryIMPORTANT REMINDER:  When you run your celery terminal, it has error notifications for installed packages, CRISPY FORM AND CRISPY BOOTSTRAP5, so we installed it again..

 

 

IT APPEARS THAT THE VIRTUAL ENVIRONMENT OF DJANGO-SERVER TERMINAL AND CELERY TERMINALS ARE DIFFERENT.

Plugging this confusion in CHATGPT, it shows this message:

4 We run our celery command again:

$ celery -A autocommontasks_main   worker --loglevel=info --pool=solo

We load our URL link:  http://127.0.0.1:8000/emails/send-email/

Our Celery terminal shows this:

 

5.



No PDF file attached.

Notebook
Notebook Details
Title: Django: Automating Common Tasks
Category: Coding