コード例 #1
0
ファイル: __init__.py プロジェクト: gorakhargosh/geoservice
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}
コード例 #2
0
ファイル: __init__.py プロジェクト: gorakhargosh/geoservice
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}