Answer the question
In order to leave comments, you need to log in
How to organize a project structure in Flask?
We decided to rewrite an existing site (on Codeigniter) on Flask.
The fact is that the project has about 20 different models (news, users, different galleries, etc.),
I would like to separate them into different, roughly speaking, subdirectories, i.e. do something like in django: in a separate model and view folder. Or you can leave the models in one file models.py, and separate the views into different files news.py, photo.py, etc., in general, so that everything is not in one heap.
I read about blueprints, I didn’t quite understand to be honest. Are there any other options?
Answer the question
In order to leave comments, you need to log in
There were draft projects on flask on the net, look at their structure. Offhand I remembered:
Look at Larger Applications from Ronacher.
I like it, I rely on it in the development of medium-sized projects.
If you have not mastered the blueprints ... Maybe it's better to take django, he will think about the structure for you.
Everything is well described in the Flask documentation. There are examples for organizing large projects, you just need to read more carefully.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question