The projects/app relationship never 'clicked' with me. I also have a dislike for the awkward 'polls' example in the django tutorial. That said, I like Django. Of course, I liked Rails better, but maybe that's because it was my 'first' and I never used any of the big php frameworks for a long period of time. I quit wasting my time with Flask for projects a while ago. It's a really great project and suited for smaller…
I feel the same way. Does any one have a good overview on how the community actually separates functionality into “apps”? I have been looking at a rails like framework in python called Masonite. Does anyone in the python/Django community think this will gain traction?
- You may have stuff that may be re-used for multiple projects. For example the departments of your organization and their attributes; these should be extracted to apps so they can be easily used for other projects. Of course this would make sense if you are a software house or an organization that need multiple apps (i.e a bank) not if you are working for a single application.
- Django recommends using a custom user model. I put that in a separate app along with any related classes like user preferences etc. See also my previous bullet.
- Non related models. If you add a model that doesn't have any relation to the rest of your models then maybe you should move it to a different app? For example in one of my applications I have a NewsItem model that is just a bunch of notes that the admins can add and will be visible to the homepage; there's no need to put it in with the rest of the app (of course this also obeys the 1st bullet)
- Beyond that, usually you'll understand when you have to separate your apps. You don't need to force it, I know of huge apps with a models or views py with thousands of lines (of course in such cases even if you think that these should belong to the same app nothing's stopping you from making them a package instead of a module). However you'll usually come to a point where you think that for your reasons you need to separate