Django. One app with many models vs. many apps with single model

Is it better to have one model per Django-app?

One of the key ideas for a reusable application is: Do one thing, and do it well

If an app needs several models (PostEntry, PostAuthor in case of a Blog App) this is by no means bad. Tags, Categories, Comments however represent distinct features which ideally can be reused in another context and therefore should be distributed as standalone apps.

Is there best practices?

To get a feeling for a good app organization I'd first take look at Django Reusable App Conventions.

Then you are ready for James Bennett's talk about Resuable Apps from DjangoCon 2008 (Slides). Another, more recent take on the same subject is Pluggable Django Application Patterns from PyCon 2011


The rule of thumb is than an "app" should be a complete piece of functionality. If your blog cannot run without tags (like literally, not just it would be nicer to have a blog with tags than without) then tags should be part of the blog app.

However, there's no clear-cut answer here. Some app-purists focus entirely on re-usability and make each app a discrete piece of functionality with little to no dependencies on anything else. Some create entire applications with a single Django app. It's really up to you to decide what makes the most sense in your particular scenario.

In general, I would say combine functionality that won't likely be used else, but is required for the app, all in the same app. Things like tags or comments are probably candidates for their own apps, and indeed, you can find many such apps available that can be simply plugged into your app to provide that functionality.

In any app more complicated than a simple to-do list, you're pretty much inevitably going to end up with a good deal of crossover, though. There's no one right answer. Just use common sense and think DRY (don't repeat yourself) and you'll do okay.


I found this guy on youtube, that says he's dealt with this exact problem: both having a huge app and lots of little ones he considers to be not good.

http://youtu.be/URztqq1kiqI?t=22m39s

From my own experience: you don't want one big app, because people can handle better folder trees that are spread a little, but not too much. Also having one app would make harder to grasp what are the components of your project (for new people)

On the other hand, the more apps you have (that do depend on one another), the more chances you have to run into circular import problems. So you need a strategy for avoiding these things. Here also, newer members would tend to drive the project into problems.

All in all, people who've developed on more projects, for longer, should usually be the ones making architectural decisions.