code: def task_status(request, task_id):
      
      result = AsyncResult(task_id)
      state, retval = result.state, result.result
      response_data = {'id': task_id, 'status': state, 'result': retval}
      if state in states.EXCEPTION_STATES:
          traceback = result.traceback
          response_data.update({'result': safe_repr(retval),
                                'exc': get_full_cls_name(retval.__class__),
                                'traceback': traceback})
      return JsonResponse({'task': response_data})
docs: Returns task status and result in JSON format.