Reputation: 11728
When developing some functionality for use with django. In this case a middleware and some other utils like a decorator. Is there any upside of making it into a Django App. The library has no models, so there is no point in a models.py (which you need to make django see it as an app), or putting into INSTALLED_APPS. But I see people doing it anyway, what are the benefits?
Upvotes: 3
Views: 147
Reputation: 1635
IMO it's handy to instantly see the list of used apps/libraries- if you miss anything, you can just pip install
or easy_install
it in the blink of an eye.
Upvotes: 0
Reputation: 8647
In my opinion, there is no benefits for middleware and decorators. My rule of thumb: If it has a model and/or views, I'll make it an app..
Even for custom template tags I chose to make it an egg and import it into the apps that will be using it.
Good question.
Upvotes: 1
Reputation: 31858
You'll have to make it an app if you want to provide templates, template tags or filters with your library. Otherwise, Django won't pick them up.
Upvotes: 2