gis.geoip2.GeoIP2.lon_lat()
  • References/Python/Django/API/Geolocation with GeoIP2

GeoIP2.lon_lat(query) Returns a coordinate tuple of (longitude, latitude).

2025-01-10 15:47:30
gis.geoip2.GeoIP2.country()
  • References/Python/Django/API/Geolocation with GeoIP2

GeoIP2.country(query) Returns a dictionary with the country code and country for the given query.

2025-01-10 15:47:30
gis.geoip2.GeoIP2.geos()
  • References/Python/Django/API/Geolocation with GeoIP2

GeoIP2.geos(query) Returns a

2025-01-10 15:47:30
gis.geoip2.GeoIP2.city()
  • References/Python/Django/API/Geolocation with GeoIP2

GeoIP2.city(query) Returns a dictionary of city information for the given query. Some of the values in the dictionary may be

2025-01-10 15:47:30
gis.geoip2.GeoIP2.country_name()
  • References/Python/Django/API/Geolocation with GeoIP2

GeoIP2.country_name(query) Returns the country name corresponding to the query.

2025-01-10 15:47:30
gis.geoip2.GeoIP2
  • References/Python/Django/API/Geolocation with GeoIP2

class GeoIP2(path=None, cache=0, country=None, city=None) The GeoIP object does not require any parameters to use

2025-01-10 15:47:30
gis.geoip2.GeoIP2.country_code()
  • References/Python/Django/API/Geolocation with GeoIP2

GeoIP2.country_code(query) Returns the country code corresponding to the query.

2025-01-10 15:47:30
gis.geoip2.GeoIP2.coords()
  • References/Python/Django/API/Geolocation with GeoIP2

GeoIP2.coords(query) Returns a coordinate tuple of (longitude, latitude).

2025-01-10 15:47:30
gis.geoip2.GeoIP2.lat_lon()
  • References/Python/Django/API/Geolocation with GeoIP2

GeoIP2.lat_lon(query) Returns a coordinate tuple of (latitude, longitude),

2025-01-10 15:47:30