Introduction to Simple Web Applications with Flask

A series on learning how to make simple, one-file Flask apps.


These set of Flask-making guides are meant for those who have had very little experience with web application development, including all the fun bits that make up web dev, such as HTML, CSS, JS – (which are all separate languages, BTW) – and such essential concepts as HTTP and HTTP status codes.

Nevermind the whole Flask app architecture.

So this series takes it slow, with lots and lots of repetition that you are meant to type out manually. Because there is no quicker way to get you up to speed than to mechanically suss out the patterns.

I also try to remove as many moving parts as possible. Thus, every Flask app in this series consists of a single file – This is not how things are typically done, and there are a lot of not-best practices in this series. But I want to keep things grounded as much as possible in standard Python syntax before we start including things like Jinja2 templating.

The articles

Hello Tiny Flask App
How to make the simplest of Python web applications.
Creating a Flask app that serves HTML
A Flask web application can serve up HTML webpages just as easy as "Hello world", because HTML is just text.
Creating Multiple Routes and Dynamic Content in Flask
How to make a Flask web app with multiple pages and dynamic endpoints.
Making a simple Flask app for viewing YouTube videos
Some practice with iframes and dynamic behavior in Flask apps.

When you're finished with this series, you can move on to the next: Introduction to Building Web Applications from Data

Things you should know about Python

If you're still figuring out Python, the series of Python fundamentals articles I created for my CompCiv class is relevant here. In particular, you should understand these parts of the Python syntax:

I'm assuming you know very little about HTML. This series covers very little of HTML, other than its just text that can be represented as Python strings. f you're really fascinated by the specifics of Hypertext Markup Language, one of the best introductions to HTML (and CSS and JS) can be found in Chapter 3 of Scott Murray's Interactive Data Visualization, which can be read online for free.