What does it do?
Some tasks, like sending an email, resizing a video, or generating a report, take too long to do while a user is staring at a loading spinner. Celery lets a website hand those slow jobs off to a separate pool of workers that process them in the background, then gets back to the user immediately, the way a restaurant takes your order and lets you sit down while the kitchen actually cooks. It uses a message broker, often Redis or RabbitMQ, as the order-ticket system passing jobs from the website to the workers. Developers can also schedule recurring jobs, like sending a summary email every Monday morning.
See it in action
This sets up a background task worker, defines a simple add-two-numbers job, sends it off to run in the background, and then waits for the answer.
from celery import Celery
app = Celery("tasks", broker="redis://localhost:6379/0")
@app.task
def add(x, y):
return x + y
result = add.delay(4, 6)
print(result.get(timeout=10))
Why would a non-developer care?
That instant order-confirmed message, followed minutes later by an actual confirmation email, is very often Celery quietly working in the background. Without something like it, websites either make users wait uncomfortably long for slow operations, or crash trying to do everything at once.
Real-world examples
Celery has been a cornerstone of the Python web ecosystem since the late 2000s and is used heavily by companies built on Django and Flask to handle everything from image processing to notification delivery. Without a background task system, a single slow operation, like generating a PDF report, could tie up the exact same server trying to load the next visitor’s page.
Who uses it
Backend engineers running web applications that need to offload slow or scheduled work, like emails, notifications, and data processing, away from the main request-response cycle.
How it compares to alternatives
Its main lightweight rival is RQ, which trades some of Celery’s flexibility for dramatically simpler setup, while Dramatiq positions itself as a more modern, opinionated alternative to both. Celery remains the default choice for teams that need mature tooling and don’t mind the extra configuration.
Fun fact
Celery was originally built by Ask Solem in 2009 to solve background task problems for Django sites, and it’s now one of the most widely deployed task queues in the Python ecosystem.