Hello,

I have a Django application that I need to appear on multiple Apache
virtual hosts with different URLs (e.g. the same view would be
accessible under http://one.site/view and under 
http://another.site/another/path/to/view).
So far, I have tried to have multiple interpreter instances under
mod_python, give each instance a different environment setting via
SetEnv, and branch in urls.py like this:

<VirtualHost *:80>
    ServerName "one.site"
    SetEnv DJANGO_URL_SITE_ONE ...
    ...
</VirtualHost>

<VirtualHost *:80>
    ServerName "another.site"
    SetEnv DJANGO_URL_SITE_TWO ...
    ...
</VirtualHost>

urls.py:

if "DJANGO_URL_SITE_ONE" in os.environ:
    urlpatterns = ... # Patterns for one.site

if "DJANGO_URL_SITE_TWO" in os.environ:
    urlpatterns = ... # Patterns for another.site

The approach seems to work somewhat (both sites are visible on the
appropriate URLs), but after doing this, the application itself became
strangely unreliable. When both sites are used, an Error 500: Internal
server error is frequently returned (but mere repeated reloading of
the same page eventually gives a correct page).

Before I go off on hunting the bug somewhere in the application (which
used to work fine before), my question is: is this approach (that is,
having multiple interpreters running multiple instances of the same
application from the same directories, accessing the same database)
something that should work ?

Thanks, Petr

--~--~---------~--~----~------------~-------~--~----~
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