Commits

timbutler committed e81eec6

Updated to use Google Client ID and Google Secret Key, as well as updating the Readme to reflect the changes

Comments (0)

Files changed (2)

 ========
 
 If working on localhost you can run into Google Maps API lockdown. If this happens
-then create a EASY_MAPS_GOOGLE_KEY in your settings.py file::
+then create a the following in your settings.py file::
 
-    EASY_MAPS_GOOGLE_KEY = "your-google-maps-api-key"
+    GOOGLE_API_CLIENT_ID = "your-google-api-client-id"
+    GOOGLE_API_SECRET_KEY = "your-google-api-secret-key"
+
+You can configure your API details at https://code.google.com/apis/console
 
 If you need a place where center the map when no address is inserted yet add the
 latitudine and longitude to the EASY_MAPS_CENTER variable in your settings.py

easy_maps/models.py

             self.geocode_error = True
             return
         try:
-            if hasattr(settings, "EASY_MAPS_GOOGLE_KEY") and settings.EASY_MAPS_GOOGLE_KEY:
-                g = geocoders.GoogleV3(settings.EASY_MAPS_GOOGLE_KEY)
+            if hasattr(settings, "GOOGLE_API_CLIENT_ID") and hasattr(settings, "GOOGLE_API_SECRET_KEY"):
+                g = geocoders.GoogleV3(client_id=settings.GOOGLE_API_CLIENT_ID,
+                                       secret_key=settings.GOOGLE_API_SECRET_KEY)
             else:
                 g = geocoders.GoogleV3(resource='maps')
             address = smart_str(self.address)