@csrf_exempt
@never_cache
def flumotion_logging(request):
    """Saves the client's log files."""
    response, group, ip = endpoint_common(request, check_group=False)
    if response is not None:
        return response

    try:
        data = json.loads(request.POST.get('data', "{}"))
    except __HOLE__, e:
        response = http.HttpResponse(content_type='text/plain')
        response.write('ERROR %s' % e)
        return response

    s = models.Flumotion(
        identifier=request.POST['identifier'],
        recorded_time=request.POST['recorded_time'],
        type=request.POST.get('type', ''),
        ip=request.META[settings.HTTP_REMOTE_ADDR_META],
        data=json.dumps(data),
    )
    s.save()

    # Write out that everything went okay
    response = http.HttpResponse(content_type='text/plain')
    response.write('OK\n')
    return response
dataset/ETHPy150Open timvideos/streaming-system/website/tracker/views.py/flumotion_logging