Flask Blueprints — Complete Tutorial to fully understand how to use it!

Felipe F Garcia
The Dev Project
Published in
12 min readJun 2, 2020

--

It’s inevitable you learn Flask and did not read or listen about “Blueprints”, but what is this? How I can use and what are the advantages of using it?

This is what I want to teach you here today, if you are completely new to Flask environment or just started to learn about Flask, I do not recommend starting with this.

The reason for this is because Blueprints is a pattern that involves different concepts put together, like, routes, it’s a way to handle your routes or build your API, architecture, as this will improve how you setup your project, you also can split and decouple, and more.

For this reason, I would recommend you first read this post: https://itnext.io/beginning-with-flask-project-the-5-most-important-information-to-know-before-starting-f075e0fb0aec.

Ok now talking about Blueprints, and the importance of using it, in general, it’s a pattern that will improve different aspects of your code, for me the 2 most important are, project structure, I would say if you want to intend to have a project that will be big it’s mandatory, and also improve how you create and organize your “routes” or your API.

Definition of Blueprint from Flask project page:

--

--

Felipe F Garcia
The Dev Project

Backend Engineer 💻 Java 👾 Python 🐍 Top Writer in Medium at the topic Technology 🚀 With a mindset to help and share knowledge 📖.