templates folder

Copy the templates folder from the completed code package into the Arenas application folder. Inside the templates folder is a folder called arenas, with a template HTML file called index.html. This file contains a JavaScript portion that generates a web map. On that map, the location of an NBA arena is displayed.

Django templates use placeholders (demarcated with a {{form.field }} format) that allow for data to be passed at runtime into the template, providing the specifics of the request. These placeholders are located throughout index.html. Django has its own built-in template language, which we will use here, and also includes Jinja2, which Flask also uses (see Chapter 11, Flask and GeoAlchemy2).

The first portion of ...

Get Mastering Geospatial Analysis with Python now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.