Question

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?

Was it helpful?

Solution

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.

OTHER TIPS

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.

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.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top