On Jan 2, 2006, at 2:13 PM, Amit Upadhyay wrote:
Djando URL resolution causes some problem with applications hosted in different subdomains. Consider www.example.com and blog.example.com. Both of them are running off the same database and share common admin, and so on, but are hosted in different subdomain, which causes problem with URL resolution. To solve this we can copy the settings file and change ROOT_URLCONF to point to different locations. I propose splitting settings.py into common_settings.py and www_settings.py. www_settings.py contains something equivalent to:
from common_settings import *
ROOT_URLCONF = 'examplecom.www_urls'
This makes clear on what to do incase there are different subdomains, we can just add other subdomains specific setting files blog_settings.py and so on, which point to different ROOT_URLCONF and so on [we can overwrite other things too if required].

What do you think?

I'm not sure I get it -- you want to automatically load a settings file based on the subdomain? That seems a little too magic for me, especially when you can already do this just by changing DJANGO_SETTINGS_MODULE for each domain...

Jacob

Reply via email to