Static websites with flask

August 22, 2015

Building static websites with frameworks such as Flask allows for a clear separation of concerns. For instance, you can separate website functionality over multiple files or use technologies, such as markdown, to generate HTML content. It gives you the benefits of a dynamic framework with the speed of serving static files.

This site itself is built using Flask. I started it based on this tutorial by Nicolas Perriault. The idea is very simple, you use the Flask microframework to control the website flow (urls, templates, etc.), flask_flatpages to read and parse markdown files from the filesystem, and finally, flask_frozen to generate the static html files.

By suggestion of some friends, I've decided to create flask-static-site. Flask-static-site is a skeleton Python/Flask application ready to be deployed as a static website. You just need to define your own styles, update the content and build the website.

Flask-static-site is released under an MIT Licence, and you can check it at