0PricingLogin
Django Academy · Lesson

Writing and Calling @shared_task

Run functions asynchronously with delay().

Tasks Are Just Functions

A Celery task is an ordinary Python function with a decorator on top. The decorator teaches Celery how to queue and run it later.

Why shared_task

Use @shared_task instead of @app.task so your tasks do not depend on a specific Celery app. It is the standard choice inside Django apps.

All lessons in this course

  1. Why You Need Background Tasks
  2. Setting Up Celery with a Broker
  3. Writing and Calling @shared_task
  4. Scheduled Jobs with Celery Beat
← Back to Django Academy