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.djangosnippets.org/snippets/1119/

Tom

On Jan 13, 5:53 pm, Donn <donn.in...@gmail.com> wrote:
> On Tuesday, 13 January 2009 19:28:01 Tom Dyson wrote:
>
> > We do something like this with middleware in theCarbonAccount[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 what visits the settings.py file
> in my project. For example:
> UPLOAD_DIR would be 'www' when the browser comes fromwww.mydomain.comand it
> would be 'comics' when from comics.mydomain.com
>
> Or am I getting this all muddled? I have the vaguest notion that settings.py
> and some other files are run once and kept in memory after that -- so perhaps
> my idea won't work anyway.
>
> \d
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to