Ok I've poured over all the SO posts, Celery docs, etc...and I just cannot figure this out. No matter what I try or how I try to call a task from a Django app, Celery is complaining that I'm not supplying the required parameters.
"TypeError: add() missing 2 required positional arguments: 'x' and 'y'".
I'm following a very simple example from their docs...simply using delay, such as:
add.delay(1, 2)
and still the same error. I've also tried add.delay(x=1, y=2)
, celery.send_task("add", [1, 2])
and a wide variety of other ways I've seen tasks called in various posts and none of them work.
The method is very simple:
@shared_task
def add(x, y):
return x + y
I've also tried it named, such as:
@task(name="my_add")
def add(x, y):
return x + y
Same results. What else can I possibly be missing?