Register for a Google Maps API key and expose it to the templates, just like we did in the Using HTML5 data attributes recipe in Chapter 4, Templates and JavaScript. Note that for this recipe, in the Google Cloud Platform console, you will need to activate Maps JavaScript API and Geocoding API. For those APIs to function, you also need to set billing data.
We will continue by creating a locations app:
- Put the app under INSTALLED_APPS in the settings:
# myproject/settings/_base.pyINSTALLED_APPS = [ # … "myproject.apps.locations",]
- Create a Location model there with a name, description, address, geographical coordinates, and picture, as follows:
# myproject/apps/locations/models.pyimport osimport uuidfrom collections import ...