3

Static websites with flask

 3 years ago
source link: https://joaoventura.net/blog/2015/flask-static-site/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

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 https://github.com/joaoventura/flask-static-site.

Enjoy!


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK