Re: Getting url/host/domain info in settings.py

2009-01-14 Thread Donn
Tom, thanks for your feedback. I guess what I was asking was how to get the domain/subdomain info from places like models and settings -- i.e. places that have no connection to a request. Still, I see a way through and will employ your suggestions. \d --~--~-~--~~~

Re: Getting url/host/domain info in settings.py

2009-01-14 Thread Tom Dyson
Settings can be altered at runtime - the middleware code I referenced does this - but the Django docs warn against it: http://docs.djangoproject.com/en/dev/topics/settings/#altering-settings-at-runtime I'd recommend using middleware to set the subdomain in the request scope, e.g.: http://www.dj

Re: Getting url/host/domain info in settings.py

2009-01-13 Thread Donn
On Tuesday, 13 January 2009 19:28:01 Tom Dyson wrote: > We do something like this with middleware in the Carbon Account[1]: I have not used middleware yet, so will look into it. I am not sure if it can supply request.META *within* settings.py though. I want to set certain variables depending on

Re: Getting url/host/domain info in settings.py

2009-01-13 Thread Tom Dyson
We do something like this with middleware in the Carbon Account[1]: http://code.thecarbonaccount.com/trac/browser/trunk/calculator/middleware/autobrand.py Hope this helps Tom [1] http://www.thecarbonaccount.com On Jan 13, 3:10 pm, Donn wrote: > Hi, > Can anyone help me get some extra info in

Getting url/host/domain info in settings.py

2009-01-13 Thread Donn
Hi, Can anyone help me get some extra info in settings.py? I have a domain that I want to point to various different Django apps depending on the 'hostname' portion of the domain name. ***.mydomain.com has (for ***): www comics stuff I want that first portion (www, comics, stuff) available in