def get_location(self): return get_country_code_from_address(request.remote_addr) or ''
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