Skip to content Skip to sidebar Skip to footer

Pass Parameter Request To A Celery Task In Django

I have a simple issue, we have as follows: @task() def upload_image(request): var = request.POST # ... do something And we call it in another method the delay for this

Solution 1:

As you can read from the docs your example should work.

from celery import task

@task()defadd(x, y):
    return x + y

add.delay(2, 2)

Solution 2:

This should work as long as you're using standard pickle serializer.

Solution 3:

This does not work with the standard pickler. See more here (basically a duplicate): passing django request object to celery task

Post a Comment for "Pass Parameter Request To A Celery Task In Django"