How to get location of the user using Flask-Simple-GeoAPI [duplicate]

from simple_geoip import GeoIP

geoip = GeoIP("your-api-key");

    data = geoip.lookup("") # Replace this with your public IP
except ConnectionError:
    # If you get here, it means you were unable to reach the geoipify
    # service, most likely because of a network error on your end.
except ServiceError:
    # If you get here, it means geoipify is having issues, so the request
    # couldn't be completed :(
    # Something else happened (non-geoipify) related. Maybe you hit CTRL-C
    # while the program was running, the kernel is killing your process, or
    # something else all together.