# -*- coding: utf-8 -*-

from django.utils.encoding import smart_str

from geopy import geocoders
from geopy.exc import GeocoderServiceError


class Error(Exception):
    pass


def google_v3(address):
    """
    Given an address, return ``(computed_address, (latitude, longitude))``
    tuple using Google Geocoding API v3.

    """
    try:
        g = geocoders.GoogleV3()

        results = g.geocode(smart_str(address), exactly_one=False)
        if results is not None:
            return results[0]

        raise Error("No results found for '%s'" % address)
    except (UnboundLocalError, ValueError, GeocoderServiceError) as e:
        raise Error(e)

@@ -134,16 +134,43 @@
 ceError%0A
+from .conf import settings%0A
 %0A%0Aclass 
@@ -395,16 +395,62 @@
 oogleV3(
+api_key=settings.EASY_MAPS_GOOGLE_MAPS_API_KEY
 )%0A%0A     

Make geocode respect API key