@RequireLogin(role='admin')
def status(request):
    if request.method != "GET":
        return HttpResponse(status=405)

    from api.models import redis_wrapper
    r = redis_wrapper.init_redis()
    response_key = str(ObjectId())
    redis_wrapper.publish_to_proxy(json.dumps({
        "operation": "status",
        "param": None,
        "key": response_key,
    }))
    for i in range(0, 50):
        response = r.get(response_key)
        if response is not None:
            return JsonResponse({"proxyStatus": response})
        else:
            time.sleep(.1)  # sleep 100ms
    return JsonResponse({"proxyStatus": None}, status=503)
Create a human readable version of a class instance.
dataset/ETHPy150Open emccode/heliosburn/heliosburn/django/hbproject/api/views/proxy.py/status--crossover with--dataset/ETHPy150Open nickjj/build-a-saas-app-with-flask/catwatch/lib/util_sqlalchemy.py/ResourceMixin.__str__