Forums

geopy

Hi everyone!

I'm trying to use geopy in my little app, but few things really bother me. I would like use google geocoder, so I should provide API KEY. To obtain API KEY for this service you have to provide IP address of server. I've tried ping my app name and use this address to obtain my api key, apparently this is not the best idea - not working. Off course I can use any other (free) geocoder service instead Google, but installed geopy version can't support ie. Nominatim. Any advice?

Tomek

OK, I've upgraded geopy module,so I can deal with Nominatim. If anyone can advice me, how to use google api-key, I would be very happy. ;)

Unfortunately, any auth system that relies on IP addresses will not work on PythonAnywhere. The IP addresses will change depending on all sorts of things and they'll definitely change every time we update the site.

OK I see.

All hope is not lost :-)

I was in the same situation and worked around by adding 0.0.0.0/0 as allowed IP range.
0.0.0.0/0 basically states that any IPv4 IP is allowed to make API calls.

Be careful to not share your API key as the IP restriction won't work anymore!

that's one way to work around it! :)

If you want to learn how to use a Google Maps API Key with GeoPy, I've wrote a simple blog post enlightning this task here : https://blog.woosmap.com/tutorials/bulk-geocoding-google-api-geopy/

Thanks galela