Apache VirtualHost do that. Listen 39986 NameVirtualHost *:39986 ServerLimit 2
<VirtualHost *:39986> ServerName domain1.com ServerAlias www.domain1.com WSGIProcessGroup django_group1 WSGIDaemonProcess django_group1 processes=2 threads=12 python-path=/home/user/djangosite:/home/user/path/python2.7 display-name=%{GROUP} WSGIScriptAlias / /home/user/path/domain1.wsgi </VirtualHost> <VirtualHost *:39986> ServerName domain2.com ServerAlias www.domain2.com WSGIProcessGroup django_group2 WSGIDaemonProcess django_group2 processes=2 threads=12 python-path=/home/user/djangosite:/home/user/path/python2.7 display-name=%{GROUP} WSGIScriptAlias / /home/user/path/domain2.wsgi </VirtualHost> <VirtualHost *:39986> ServerName subdomain3.domain3.com ServerAlias subdomain3.domain3.com WSGIProcessGroup django_group3 WSGIDaemonProcess django_group3 processes=2 threads=12 python-path=/home/user/djangosite:/home/user/path/python2.7 display-name=%{GROUP} WSGIScriptAlias / home/user/path/domain3.wsgi </VirtualHost> On Tue, Apr 10, 2012 at 11:42 AM, Mario Gudelj <mario.gud...@gmail.com>wrote: > Hey man, > > See if this helps > http://tidbids.posterous.com/saas-with-django-and-postgresql-schemas > > Cheers, > > -m > > > On 10 April 2012 21:53, Bernardo <carneiro...@gmail.com> wrote: > >> I would like to create a subdomain based authentication system, like the >> one on 37signals, freshbooks, codebase, etc. The objective is to do >> something like smaller but in far smaller scale (I suppose a maximum of >> 100-1000 blogs). All other models (blog posts, comments, etc) already have >> a foreign key to Site. >> >> 1. How can I allow different users to have the same username in different >> sites? How can I make so that when a user logs in, he logged in to a >> specific site (logging on blog A does not log you to blog B). >> >> For allowing the same username in different sites I guess I'd have to >> write my own authentication backend and a new model for User, as I don't >> see how the default User model would fit. Is this a good approach? >> >> 2. Is there anyway to make the sites framework fetch the current site >> based on the subdomain instead of the settings? Or am I seeing this the >> wrong way? >> >> My plan was to use a single deployment for everything and use the sites >> framework, but as far as I've understood, the sites framework relies on the >> settings.SITE_ID parameter, which would be the same for a single >> deployment. What would be a good approach here? Creating a new settings >> file for each new blog? >> >> Many thanks in advance! >> >> -- >> You received this message because you are subscribed to the Google Groups >> "Django users" group. >> To view this discussion on the web visit >> https://groups.google.com/d/msg/django-users/-/zQimMoWFGNUJ. >> To post to this group, send email to django-users@googlegroups.com. >> To unsubscribe from this group, send email to >> django-users+unsubscr...@googlegroups.com. >> For more options, visit this group at >> http://groups.google.com/group/django-users?hl=en. >> > > -- > 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+unsubscr...@googlegroups.com. > For more options, visit this group at > http://groups.google.com/group/django-users?hl=en. > -- juanpex -- 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+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.