kahless wrote:
> hi,
> i want to make a simple template loader which loads from directories
> depending on the sub-site the user requests a page from. (or probably
> also from the user session - which theme he has set, etc.)
>
> so i would need to get the current request object but haven't found a
> solution for that problem in the documentation.
>
> Since i'm new to python, there might be some easy way .. e.g. like
> ThreadLocal's in java .. altough i guess mod_python and others don't
> use threads, but processes ? so i could simply put the request object
> in a globally accessible variable ? (i know, it's a bad design .. but i
> see no other way to get the request object ?)
>
>
> Another way would be to create a middleware and change the
> settings.TEMPLATE_DIRS tuple .. but this seems to be even more dirty ..
> (and the django documentation also discourages changing settings
> outside the main site's settings.py)

If you are running Django under Apache/mod_python, you may be better
off investigating Apache's VirtualHost directive and run distinct
instances of Django for each separate virtual host.

And mod_python does use threads, but only when used on Windows or on
UNIX with the "worker" MPM. By default UNIX systems still use "prefork"
MPM so your version of Apache would need to have been explicitly
compiled with "worker" MPM support.

Graham


--~--~---------~--~----~------------~-------~--~----~
 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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to