3 ms·
Where app directories are incredibly useful is in Django library development. They're a really convenient way to hook in models, static files, template helpers,
by Osmose 9y ago
Where app directories are incredibly useful is in Django library development. They're a really convenient way to hook in models, static files, template helpers, etc. to an existing Django site, without forcing users to do a bunch of setup work when integrating your library. It's not a coincidence that most Django libraries have a very similar setup:
1. Install the package
2. Add the package to settings.INSTALLED_APPS (and middleware, etc).
3. Profit!
For an instance of a Django site, apps are less useful, and the article's recommendation to be more careful when splitting your site into multiple apps is great advice.
- randomsearch 9y agoYeah, I agree. Makes sense for libraries. So keep that separate for library writers, don't expose me to the complexity of that.
- andybak 9y agoThe benchmark I use is "Is it probable that this app might become shared between projects?" Using a Django 'app' for this makes sense. If it's generic enough that I might consider moving it into it's own repo then it's probably not going to be heavily intertwined with the rest of the project.