I'm no expert - but I picked up on this as you linked to my website
and my subdomains article.

Since writing that snippet I've moved the subdomain code out into some
nifty Middleware that sets a few 'request' variables so they're always
available in my views & templates. In another example where different
companies have their own subdomains (via a Company model), the
middleware confirms the current user (eg request.user) is allowed to
access data for that company (if request.user in
Company.user_set.all(), or something similar), raises the relevant
error page if they don't have access, and if they do it sets
request.company (an instance of the Company model) and Django
continues by selecting the right view to use.

Is it possible to alter the settings on-the-fly? If so modifying
settings.SITE_ID may work for some people, especially where you want
to use different content for different sites. In my case, I'm using
subdomains to limit access a different subset of data, but using the
same views/models/templates.

Ross


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to