Exemplo n.º 1
0
def get_country_by_ip_address(ip_address):
    country_code = _get_country_code_by_ip_address(ip_address)
    country_name = COUNTRY_NAME_ISO_ALPHA_2_TABLE.get(country_code, country_code)

    return {'country_code': country_code, 'country_name': country_name}
Exemplo n.º 2
0
def get_country_by_domain(domain):
    country_code = _get_country_code_by_domain(domain)
    country_name = COUNTRY_NAME_ISO_ALPHA_2_TABLE.get(country_code, country_code)

    return {'country_code': country_code, 'country_name': country_name}