<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def progress(request):
 """ Check status of task. """

    if 'delete' in request.GET:
        models.MachineCache.objects.all().delete()
        models.InstituteCache.objects.all().delete()
        models.PersonCache.objects.all().delete()
        models.ProjectCache.objects.all().delete()
        return render(
            template_name='main.html',
            context={'content': 'Deleted'},
            request=request)

    if request.method == 'POST':
        if 'task_id' in request.POST:
            result = Task.AsyncResult(request.POST['task_id'])
            if result.failed():
                value = {
                    'info': {},
                    'ready': result.ready(),
                }
            else:
                value = {
                    'info': result.info,
                    'ready': result.ready(),
                }
            return HttpResponse(
                json.dumps(value), content_type="application/json")
    return None