Complete the code to import Celery in your Django project.
from celery import [1]
You import Celery class from the celery package to create a Celery app instance.
Complete the code to create a Celery app instance named 'app'.
app = Celery('[1]')
The argument is usually your Django project name, here 'myproject'.
Fix the error in the code to load Django settings into Celery.
app.config_from_object('[1]')
The correct string to load Django settings is 'django.conf:settings'.
Fill both blanks to auto-discover tasks in Django apps.
app.[1]_tasks() # Auto-discover tasks in installed apps app.conf.broker_url = '[2]'
autodiscover_tasks() finds tasks.py files in apps.
The broker URL here uses Redis on localhost.
Fill all three blanks to define a simple Celery task function.
from celery import shared_task @shared_task def [1](x, y): return x [2] y # Returns sum result = [3](4, 5).delay()
The task function is named 'add'. It returns the sum using '+'.
The task is called by its name 'add' with .delay() to run asynchronously.
