Monday, May 31, 2010

Django serving multiple subdomain sites -- okay to use thread-locals?

We're adapting our Django powered video site to be an open video
platform for any user to create their own "site" using subdomains (eg
mysite.vidplatform.com) on one Django server instance. Each "site"
would obviously have content associated with only that site in
addition to template and navigation customizations.

Adapting the ``django-multisite`` app seems best and is working well
on our dev server:
http://github.com/shestera/django-multisite

However, a number of Django developers have expressed concerns using
thread-locals: http://code.djangoproject.com/wiki/CookBookThreadlocalsAndUser

I don't see any other option besides using thread-locals to
dynamically update SITE_ID per request.

What would be another way of accomplishing this goal without thread-
locals if indeed this is not best practice?

Thanks in advance for your input.

Kieran

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

No comments:

Post a Comment