Flask project structure, the right choice to start.

Felipe F Garcia
The Dev Project
Published in
5 min readMar 8, 2021

--

The first and most important decision that you will ever make for your project is how you can organize it.

Also, this is the decision that will lead you to have more or fewer problems in the future, so making it right now will avoid problems for yourself later.

Photo by Anete Lusina from Pexels

What is the best Flask project structure?

This is a question that you should ask yourself from the beginning, but the problem with this is, what will your project need, is it different from other projects you’ve done already? How can I have one single project structure that will make sure my project will not have a problem, while at the same time will also allow me to improve and keep growing?

The answer is that you don’t have this kind of structure, but, you have one pattern for your structure that will allow you to keep growing and not block and create more problems.

The baseline for any Flask project structure.

1 — Single module structure.

There are 2 basic formats that you can start your project, one is using a Single Module format.


my_project/
app.py
config.py
requirements.txt
static/
templates/
views/

--

--

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 📖.