madisona / django-google-maps

Using the Google Maps API with django model admin
BSD 2-Clause "Simplified" License
281 stars 99 forks source link

"Geocode was not successful because of the following reason": ERROR #23

Closed mykljohn closed 6 years ago

mykljohn commented 7 years ago

I'm trying to test this out and I get the above error.

I'm on Python 2.7, Django 1.11

madisona commented 7 years ago

Can you post any more info? And do you have GOOGLE_MAPS_API_KEY = '<SAMPLE_KEY>' set to an appropriate value in your settings?

mykljohn commented 7 years ago

Sure, yes I have my API key.

in my model: address = map_fields.AddressField(max_length=200) location = map_fields.GeoLocationField(max_length=200)

in admin: formfield_overrides = { map_fields.AddressField: {'widget': map_widgets.GoogleMapsAddressWidget}, }

The Admin screen comes up and displays the fields and the map in Satellite view (can I change that and center it on a location?) When I enter a city name, it pops up that error msg.

madisona commented 7 years ago

the project expects to update a field #id_geolocation. It looks like you named the field location in your model.

You can try either changing the field name to be geolocation or explicitly set the html id to be id_geolocation.

mykljohn commented 7 years ago

ah ok, same problem. New model: address = map_fields.AddressField(max_length=200) geolocation = map_fields.GeoLocationField(max_length=200)

madisona commented 7 years ago

what is the address you're trying to geocode?

mykljohn commented 7 years ago

I just put in the city "Queretaro" without quotes :)

mykljohn commented 7 years ago

and I tried New York...same thing

madisona commented 7 years ago

do you get the same result if you just pull down the django-google-maps project and run the included sample application?

I just pulled it down and ran the sample app without issues on python 27 and django 1.11. both "New York" and "Queretaro" behave as I'd expect.

mykljohn commented 7 years ago

Sorry, I'll try it this weekend.