M
M
Mat1lda2020-04-18 18:53:16
Django
Mat1lda, 2020-04-18 18:53:16

Django. Should I separate each model/view into a separate file?

Actually picking turnips on the git, I saw an example where instead of a single file models.py there was a folder in which each model was in a separate file (well, __init__.py to have a package). Actually, in my opinion, it is quite a reasonable topic, what do people think it is interesting to know?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Sergey Gornostaev, 2020-04-18
@Mat1lda

This makes sense if models.py or views.py got too big. But in this case, it is better not to separate models and views into separate files, but to split the application into smaller ones.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question