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

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