> 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
>
>


Django sites can help take a look at:

http://docs.djangoproject.com/en/dev/ref/contrib/sites/?from=olddocs#django.contrib.sites.django.contrib.sites.models.Site



saludos


Leonel


_______________________________________________
Cherokee mailing list
[email protected]
http://lists.octality.com/listinfo/cherokee

Reply via email to