Reputation: 17067
I have been reading a lot of django articles, including the official doc. Occasionally, I would see multiple instances of an app being mentioned without going into the details of it. This leads me to start thinking what are the uses/applications of having multiple instances of an app. A few examples would be appreciated.
In the section URL Dispatcher of the official doc, I read:
The Django Admin is deployed as instances of a AdminSite
Why multiple instances are needed here?
Upvotes: 5
Views: 1002
Reputation: 18529
Say you design an app that creates a forum with categories, sub-categories, user profiles etc. Now company A that makes cars wants to use your software without going through the trouble of hosting it. So does company B that makes bikes. You could host both of them as multiple instances of your forum app.
Another example would be something like Google Apps that can be hosted on your domain. Each separate instance contains email, docs & a lot more. You can add whichever apps you want.
Upvotes: 1
Reputation: 50786
You could for example make another instance of AdminSite
available under a different url than /admin
- you could for example register different ModelAdmins with this second instance or have it customized in a different way. In the Django documentation you will also find some attributes of AdminSite
that give you the possibility to customize it.
Also there can be use cases where you would need to subclass AdminSite
to give it the properties you desire...
Upvotes: 2