[Answer]-Celery with Django – AttributeError: 'AsyncResult' object has no attribute 'replace'

1👍

disambiguation_task.apply_async([json.dumps(json_request)]) returns AsyncResult object, not a task id. So simply:

task_result = disambiguation_task.apply_async([json.dumps(json_request)])

# if you need to use the task_id somewhere else
async_result = AsyncResult(id=task_result.id, app=disambiguation_task)
👤ZZY

Leave a comment