Ejemplo n.º 1
0
 def get_location(self):
     return get_country_code_from_address(request.remote_addr) or ''
Ejemplo n.º 2
0
def handle_location_header(response):
    if 'X-Rockpack-Get-Client-Location' in request.headers:
        location = get_country_code_from_address(request.remote_addr) or ''
        response.headers.add('X-Rockpack-Client-Location', location)
    return response