On Dec 9, 6:53 pm, "[EMAIL PROTECTED]"
<[EMAIL PROTECTED]> wrote:
> Hi, I'm converting to the excellent mod_wsgi and wondering if it's
> possible to make a single httpd virtual host/wsgi file to manage
> wildcard subdomains.
>
> Basically I have an app where i'm creating a new instance for each
> client and using subdomains. So client1.example.com and
> client2.example.com both point to the same app, but their own
> settings.py/django instance.
>
> So far so fine.  I've been happily converting to mod_wsgi daemons,
> creating virtual hosts and independent .wsgi files for each one. But
> now just wondering whether there is some way i can make this process
> dynamic so one virtual host/.wsgi file will take care of all these
> subdomains.
>
> I see the advice on the wsgi wiki to push domain sub-directories to
> different django instances, but i'd rather keep using the subdomains
> if possible.
>
> It looks possible to be able to parse information about the incoming
> request in the wsgi file and push it to different settings. But i'm
> not sure what this will do in terms of spawning processes etc, it
> looks a little dangerous, or maybe this will work. Any advice
> appreciated thanks!

Start by reading recent discussion:

  http://groups.google.com/group/django-users/browse_frm/thread/dfd352162db59ed7

I'll post more tomorrow if have time, have to do some things tonight
and then out most of the day tomorrow.

In short though, no support for dynamic transient daemon processes
yet, ie.,:

  http://code.google.com/p/modwsgi/issues/detail?id=22

so, can't get away from using WSGIDaemonProcess for each instance at
the moment.

One can use dynamic setting of WSGIApplicationGroup via a variable set
by mod_rewrite to select daemon process as well as set some name
relevant to settings file. WSGI application wrapper can then be used
to override DJANGO_SETTINGS_MODULE.

So, information is in that post, you just need to adapt it to your
situation. That is, use SERVER_NAME rather than REMOTE_USER from
authentication as basis of selecting daemon process group. You could
though skip the rewrite maps that allowed multiple levels of
indirection and made it further dynamic in nature.

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