On Nov 1, 4:54 am, Håkan Waara <[EMAIL PROTECTED]> wrote:
> 31 okt 2008 kl. 16.43 skrev ilyail3:
>
>
>
>
>
> > hello people, Is there a way to host several django projects under a
> > single virtual host?
> > I know this is possible with mod_php with wildcards as server alias
>
> > and later map urls to dirs using mod_rewrite
>
> > <VirtualHost *>
> >    DocumentRoot /var/www
> >    ServerNamewww.projects
> >    ServerAlias *.projects
> >    RewriteEngine on
> >    RewriteCond %{HTTP_HOST} !^www.* [NC]
> >    RewriteCond %{HTTP_HOST} ^([^\.]+)\.projects
> >    RewriteCond /var/www/%1 -d
> >    RewriteRule ^(.*) /%1/$1 [L]
> > </VirtualHost>
>
> > But is it possible to run django projects from a directory in a
> > similar way.
>
> > Sorry if I'm asking a question someone have asked before , couldn't
> > find anything on this topic
>
> Are you using mod_wsgi, mod_python or what?
>
> If you're using mod_wsgi: From what I gather, running multiple django  
> projects under the same VirtualHost currently has things to deal with  
> to get it working. 
> (Seehttp://code.google.com/p/modwsgi/wiki/IntegrationWithDjango
>   -- search for "Note that Django expects").

Yes, mod_wsgi will by default run different WSGI applications within a
VirtualHost in different sub interpreters of same process. It has the
added benefit though that you could also delegate each application in
same virtual host to different daemon process groups. That or even mix
and match them, having some delegated out to separate process at the
same time as keeping some running in the Apache child processes.

In mod_python, the default is to run all applications within a
VirtualHost (regardless of listener port), in the same sub
interpreter. For Django, because DJANGO_SETTINGS_MODULE global, this
will not work. For mod_python you need to use PythonInterpreter
directive and manually designate that applications should run in
different sub interpreters.

Thus, mod_wsgi is far more flexible than mod_python in this respect.

Graham
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to [email protected]
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