Flask and its component modules
Flask, as opposed to Django and GeoDjango (covered in Chapter 12, GeoDjango), does not include batteries. Instead, it allows a number of supporting modules to be installed as needed. This gives more freedom to you as the programmer, but it also makes it necessary to install the required components separately.
I've chosen some modules for this chapter that will allow us to create a Flask application with a geospatial component. The following sections will detail how to set up, install, and utilize these modules to generate a website, using a demonstration site with a PostGIS database backend (as covered in Chapter 7, Geoprocessing with Geodatabases) and the ability to perform spatial queries through a web-based interface.
Setup
A number of important Python modules must be in place to ensure that the Flask application and its connection to the PostgreSQL and PostGIS database components, will run as required. These modules will be downloaded and installed using...