Reputation: 52323
I'm using the middleware to detect the subdomain and place a corresponding object in the request scope. Would it be possible to take it further and declare that the subdomain implements these urls but not those?
Something like?
if request.subdomain.is_blue:
include(these.urls)
Upvotes: 0
Views: 1247
Reputation: 62651
the urlconf is executed at startup time, not for each request; so you don't have the opportunity to include or not according to the URL used to acess.
the best would be to write your own middleware, or a restricting decorator (like @login_required), it's quite easy to write your own decorator (i like them more than middlewares for most specific tasks)
Upvotes: 5