G
G
German Jet2015-01-15 21:18:46
Flask
German Jet, 2015-01-15 21:18:46

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

3 answer(s)
A
Alexey, 2015-01-15
@GeraJet

There were draft projects on flask on the net, look at their structure. Offhand I remembered:

  • flask-kit
  • fbone

X
xSkyFoXx, 2015-01-15
@xSkyFoXx

Look at Larger Applications from Ronacher.
I like it, I rely on it in the development of medium-sized projects.

B
bromzh, 2015-01-15
@bromzh

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 question

Ask a Question

731 491 924 answers to any question