Hi,

Wish you all a very happy and fruitful new year!

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?

--
Amit Upadhyay
Blog: http://www.rootshell.be/~upadhyay
+91-9867-359-701

Reply via email to