Bird
0
0

You want to send a weekly report email to thousands of users without slowing your Django site. Which approach best uses background tasks?

hard📝 Conceptual Q8 of 15
Django - Celery and Background Tasks
You want to send a weekly report email to thousands of users without slowing your Django site. Which approach best uses background tasks?
ARun a script manually once a week outside Django
BSend all emails directly in the view when users visit the site
CStore emails in the database and send when users log in
DSchedule a periodic background task that sends emails in batches
Step-by-Step Solution
Solution:
  1. Step 1: Identify scalable email sending

    Sending thousands of emails at once blocks the site if done synchronously.
  2. Step 2: Use periodic background tasks

    Scheduling a background task to send emails in batches avoids blocking and automates the process.
  3. Final Answer:

    Schedule a periodic background task that sends emails in batches -> Option D
  4. Quick Check:

    Batch background tasks scale well = C [OK]
Quick Trick: Use scheduled batch tasks for large email jobs [OK]
Common Mistakes:
MISTAKES
  • Sending emails synchronously in views
  • Relying on manual scripts
  • Triggering emails on user login

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Django Quizzes