def endpoint_common(request, check_group=True):
    if request.method != 'POST':
        return NeverCacheRedirectView.as_view(url="/")(request)

    response = http.HttpResponse(content_type='text/plain')

    if not CONFIG['config'].get('secret', None):
        response.write('ERROR CONFIG (No secret)\n')
        return response, None, None

    secret = request.POST.get('secret', '')
    if secret != CONFIG['config']['secret']:
        response.write('ERROR SECRET\n')
        return response, None, None

    if check_group:
        group = request.POST.get('group', '')
        if not CONFIG.valid(group):
            response.write('ERROR GROUP\n')
            return response, None, None
    else:
        group = None

    ip = request.META[settings.HTTP_REMOTE_ADDR_META]

    return None, group, ip
Check the common information for an endpoint request.
dataset/ETHPy150Open timvideos/streaming-system/website/tracker/views.py/endpoint_common