Challenge - 5 Problems
Celery Setup Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
🧠 Conceptual
intermediate1:30remaining
What is the primary role of Celery in a Django project?
Choose the best description of what Celery does when integrated with Django.
Attempts:
2 left
💡 Hint
Think about tasks that run separately from immediate user requests.
✗ Incorrect
Celery allows Django to run tasks asynchronously, meaning tasks can be processed in the background without blocking the main web server.
📝 Syntax
intermediate1:00remaining
Which command correctly installs Celery for a Django project?
Select the exact pip command to install Celery compatible with Django.
Attempts:
2 left
💡 Hint
Celery is installed as a standalone package, not a Django-specific package.
✗ Incorrect
The correct package to install is 'celery'. The 'django-celery' package is outdated and no longer recommended.
❓ component_behavior
advanced1:30remaining
What happens if you forget to start the Celery worker after setup?
After configuring Celery in Django, what is the result if you do NOT run the Celery worker process?
Attempts:
2 left
💡 Hint
Consider how Celery processes tasks separately from Django.
✗ Incorrect
Celery workers must be running to pick up and execute tasks. Without workers, tasks queue up but do not run.
🔧 Debug
advanced2:00remaining
Identify the error in this Celery setup snippet
Given this Celery app setup in Django, what error will occur?
code:
from celery import Celery
app = Celery('proj')
app.config_from_object('django.conf:settings', namespace='CELERY')
app.autodiscover_tasks()
Options:
Attempts:
2 left
💡 Hint
Check method calls and parameters carefully.
✗ Incorrect
The snippet correctly creates a Celery app, loads Django settings with the proper namespace, and autodiscovers tasks without arguments.
❓ state_output
expert2:00remaining
What is the output when calling a Celery task synchronously with .delay()?
Consider this Celery task in Django:
@celery_app.task
def add(x, y):
return x + y
What is the type and value of result when calling result = add.delay(4, 5)?
Attempts:
2 left
💡 Hint
Think about how Celery handles task calls asynchronously.
✗ Incorrect
Calling .delay() queues the task and returns an AsyncResult object immediately. The actual result is computed later by a worker.