I'm having a tough problem with Apache messing-up with my settings and
urls. Does anyone have any idea of what I'm doing wrong?

Question: can I have different 'settings.py' for each Django app
running in Apache? As far as I could understand Django docs it should
be possible, but...

Here's what's happening:

I have 2 Django applications configured: app_1 and app_2. Both of them
indidvidually work. However they respective urls.py get messed-up if I
switch from one app to the other. Here's the strange behavior:

1. I restart Apache
2. I point my browser to app1/index:
     everything is OK
3. I point my browser to app2/index:
     I get an error telling me that the requested URL does not. Then
the
     error page tells me that Django tried to use 'app_1.urls', while
I
     was expecting Django would use 'app_2.urls' instead.

If I repeat the above steps trying access, at first, app2/index, I get
the same strange behavior. But, this time, app1 fails because
'app_2.urls' is used instead of 'app_1.urls',

It seems to me that Apache statically loads 'urls.py' the very first
time and it is unique for both apps, even if different urlconf are
defined within each module. In fact, each 'settings.py' I properly set
the ROOT_ULRCONF to point to the proper urlconf.

Here's the structure of my directories:

  /var/www/
      myapps/
          __init__.py
          app_1/
              settings.py (ROOT_URLCONF = 'app_1.urls')
              urls.py
              __init__.py
          app_2/
              settings.py (ROOT_URLCONF = 'app_2.urls')
              urls.py
              __init__.py

And here's how I defined the apps in Apache2 (running with lastest
Django SVN).

<Location "/app1/">
    SetHandler python-program
    PythonPath "['/var/www/myapps'] + sys.path"
    PythonHandler django.core.handlers.modpython
    SetEnv DJANGO_SETTINGS_MODULE app_1.settings
    PythonDebug on
</Location>

<Location "/app2/">
    SetHandler python-program
    PythonPath "['/var/www/myapps'] + sys.path"
    PythonHandler django.core.handlers.modpython
    SetEnv DJANGO_SETTINGS_MODULE app_2.settings
    PythonDebug on
</Location>


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