(request)
return data
Pass request object and returns parsed data dict.
    Country is fetched from IP using maxmind db.

    :param request:
    :return:
Pass request object and returns parsed data dict.
    Country is fetched from IP using maxmind db.
Pass request object and returns parsed data dict . Country is fetched from IP using maxmind db .
def parse_header(request):
    """Pass request object and returns parsed data dict.
    Country is fetched from IP using maxmind db.

    :param request:
    :return:
    """
    ip = request.headers.get('Pygmy-App-User-Ip')
    data = dict(
        referrer=request.headers.get('Pygmy-Http-Rreferrer'),
        user_agent=request.headers.get('Pygmy-Http-User-Agent'),
        country=ip_country(ip)
    )
    return data
def parse_header ( request ) : ip = request . headers . get ( 'Pygmy-App-User-Ip' ) data = dict ( referrer = request . headers . get ( 'Pygmy-Http-Rreferrer' ) , user_agent = request . headers . get ( 'Pygmy-Http-User-Agent' ) , country = ip_country ( ip ) ) return data