Flask – a microframework

To get a taste of working with a Python web framework, we're going to write a small app with Flask. We've chosen Flask because it provides a lean interface, giving us the features we need while getting out of the way and letting us code. Also, it doesn't require any significant preconfiguration, all we need to do is install it, like this:

>>> pip install flask
Downloading/unpacking flask

Flask can also be downloaded from the project's homepage at http://flask.pocoo.org. Note that to run Flask under Python 3, you will need Python 3.3 or higher.

Now create a project directory, and within the directory create a text file called tinyflaskapp.py. Our app is going to allow us to browse the docstrings for the Python built-in functions. ...

Get Learning Python Network Programming 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.