And what about use the "request" parameter ? Link : http://docs.djangoproject.com/en/dev/ref/request-response/#django.http.HttpRequest.get_host
You can use the request.get_host() to know what is the host using, and so make what you want (some split and catch the first part "user1"). 2009/4/9 Rodrigo C. <rodrigo...@gmail.com> > > Is there a way to catch a subdomain and pass it to a view function? > > For example, if I have a site "sitename.com", and a user called > "user1", I would like to be able to have "user1.sitename.com" be > hooked into the user's profile, for example, so I'd need to be able to > pass the subdomain to my view function. > The site will be hosted on Webfaction, if that makes a difference. > > Thanks, > > Rodrigo > > > --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---