Skip to Content
Flask Framework Cookbook - Second Edition
book

Flask Framework Cookbook - Second Edition

by Shalabh Aggarwal
July 2019
Beginner to intermediate
302 pages
9h 38m
English
Packt Publishing
Content preview from Flask Framework Cookbook - Second Edition

Getting ready

In Python 3, mock has been included as a standard package in the unittest library.

For the purpose of this recipe, first, we need to install the geoip2 library and the corresponding database:

$ pip3 install geoip2

You also need to download the free geoip database from the MaxMind website to a location of your preference and then unzip the file. For the sake of simplicity, I have downloaded it to the project folder itself:

$ wget https://geolite.maxmind.com/download/geoip/database/GeoLite2-City.tar.gz$ tar -xvzf GeoLite2-City.tar.gz

After completing the preceding steps, you should have a folder with the prefix Geolite2-City-. This folder contains the geoip database with the .mmdb extension that we will use ahead in this recipe. ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Writing a Web Application with Flask

Writing a Web Application with Flask

Doug Farrell
Mastering Flask

Mastering Flask

Jack Stouffer

Publisher Resources

ISBN: 9781789951295Supplemental Content