Complete the code to import Celery in a Flask app.
from celery import [1]
The Celery class is imported with a capital C as Celery.
Complete the code to create a Celery instance with Flask app name.
celery = Celery([1])The Celery instance is created with the Flask app name as a string, e.g., 'myapp'.
Fix the error in the Celery configuration dictionary key for broker URL.
celery.conf.update({ 'broker_[1]': 'redis://localhost:6379/0' })The correct key for the broker address is broker_url.
Fill both blanks to schedule a periodic task every 10 seconds using Celery Beat.
from celery.schedules import [1] celery.conf.beat_schedule = { 'task-every-10-seconds': { 'task': 'tasks.my_task', 'schedule': [2](10.0), }, }
crontab for seconds interval which is for cron-like schedules.timedelta which is not a Celery schedule.The interval schedule is used for periodic tasks every fixed seconds.
Fill all three blanks to define a Celery task function that prints 'Hello' every minute.
@celery.task async def [1](): print([2]) celery.conf.beat_schedule = { 'hello-every-minute': { 'task': '[3]', 'schedule': interval(60.0), }, }
The task function is named hello_task. The print statement prints the string 'Hello'. The task name in the schedule is the string 'hello_task'.