[Answered ]-Access Requests Method within Celery Task

1👍

You can work with .urlencode(…) [Django-doc] to convert it to a string object and back:

def index(request):
    run_tasks.delay(data=request.GET.urlencode())
    return render(request, 'example/index.html', {'task_id': task.task_id})

at the receiving end, you can then reconstruct the QueryDict with:

from django.http import QueryDict

def some_task(data):
    GET = QueryDict(data)
    # work with GET …
    pass

Leave a comment