django url rewrite without redirect

2013-02-02 Thread Tom Lesters
I'm using django and have hundreds of subdomain url abc.domain.com want to rewrite to domain.com/site/abc/ Is it possible via url-rewriting that the user won't see domain.com/site/abc/ in his browser, but sees abc.domain.com I think this can be done with apache configuration. But my questio

Re: django url rewrite without redirect

2013-02-04 Thread Nikolas Stevenson-Molnar
If the targets are all within your Django project, then you write a view which parses out the subdomain, resolves the correct view function, and then passes the request on to that view. Something like: from django.core.urlresolvers import resolve def rewrite(request): subdomain = request.META[