def success_response ( * * data ) : data_out = { } data_out [ "status" ] = "success" data_out . update ( data ) js = dumps ( data_out , default = date_handler ) return Response ( js , status = 200 , mimetype = "application/json" )
python return response ajax
Return a generic success response .
def success_response(**data):
    """Return a generic success response."""
    data_out = {}
    data_out["status"] = "success"
    data_out.update(data)
    js = dumps(data_out, default=date_handler)
    return Response(js, status=200, mimetype="application/json")