Ooops! I forgot the list. Sorry... Read below. On Wed, Aug 12, 2009 at 12:52 AM, Pablo Hernan Saro <[email protected]>wrote:
> Hi Mario, > > As far as I know, you can do something like this in apache (in the vhost > configuration): > ServerAlias *.yourdomain.com > > Well, this is cherokee, I know... Don't punch me! =P > If cherokee is able to do something like this, then it is so easy to handle > subdomains in Django. > If you request hotpotato.example.com, Django provides > request.META['HTTP_HOST'] with that information. So you can play a little > bit to accomplish what you need by simply splitting it and getting the > subdomain (hotpotato). Then you can call a view named as the requested > subdomain (just an example). > > So, my question would be: is cherokee able to handle wildcards in vhosts > definition? > > Hope it helps. > Cheers > > Pablo > > 2009/8/12 Mario César Señoranis <[email protected]> > >> Hello all, >> >> I was trying to deploy a Django application for managing subdomains as >> specific apps, something like devianart.com for example. that >> username.domain.com trows the user dashboard instead the homepage of the >> website. >> >> So, I came with a solution, to chose the urls.py of the project making a >> difference if the user come from the main domain or a subdomain, if on >> the request I get the subdomain I load just an specific urls.py. >> >> In my 'plans' I need to to create a vhost for the main site, that >> catches the domain.com and www.domain.com, and another vhost that caches >> everything else *.domain.com, both vhost would have the same Information >> Source, to get the load of the urls.py be different I want to set >> something like a *custom* setting for each vhost, creating a Custom >> Environment variable in the SCGI handler. >> >> In my understanding creating some X_SETTING with the value 1, for >> example. I could get the value on the django application doing >> >> import os >> xsetting = os.environ['X_SETTING'] >> if xsetting == 0: >> #load the main domain urls.py >> elif xsetting == 1 >> #load the some user app urls.py >> >> This, as for me looks logical, always raise an non existing key >> exception, Am I understanding well the use of the Custom Environment >> Variables? This works as I am thinking? Is obvious that no :) >> >> I would appreciate any hint about the usage of the Custom Environ >> Variables. >> >> -- >> Mario César Señoranis Ayala >> >> Twitter: http://twitter.com/mariocesar_bo >> Arte: http://mariocesar.deviantart.com >> Blog Software Libre: http://softwarelibre.org.bo/mariocesar >> Noticias Compartidas: http://tinyurl.com/mariocesar-shared-news >> >> _______________________________________________ >> Cherokee mailing list >> [email protected] >> http://lists.octality.com/listinfo/cherokee >> >> >
_______________________________________________ Cherokee mailing list [email protected] http://lists.octality.com/listinfo/cherokee
