this module houses the geoip2 object a wrapper for the maxmind geoip2r python api https geoip2 readthedocs io this is an alternative to the python geoip2 interface provided by maxmind geoipr is a registered trademark of maxmind inc for ipbased geolocation this module requires the geolite2 country and city datasets in binary format csv will not work the datasets may be downloaded from maxmind at https dev maxmind comgeoipgeoip2geolite2 grab geolite2country mmdb gz and geolite2city mmdb gz and unzip them in the directory corresponding to settings geoippath noqa
__all__ = ["HAS_GEOIP2"]

try:
    import geoip2  
except ImportError:
    HAS_GEOIP2 = False
else:
    from .base import GeoIP2, GeoIP2Exception

    HAS_GEOIP2 = True
    __all__ += ["GeoIP2", "GeoIP2Exception"]