Last Updated: May 22, 2026
The last three lessons looked at Python as a client of the web. The next step is the other direction: writing a server. Flask is the smallest of Python's popular web frameworks: a few hundred lines of glue around a couple of older libraries, with no opinion about databases, templates, or project layout. A working web service fits in five lines of code. This lesson covers the Flask basics: defining routes, accepting form and JSON data, returning JSON responses, capturing URL parameters, the request and application contexts, and running Flask in development versus production.