title: Deploying multiple django apps on Apache with mod_wsgi
body: <p>I want to deploy two different django apps in the same host: The first will correspond to the url /site1 and the second to the url /site2. Here's my configuration:</p>
  
  <pre>
  LoadModule wsgi_module modules/mod_wsgi.so
  
  WSGIScriptAlias /site1 /var/www/py/site1/site1/wsgi.py
  WSGIScriptAlias /site2 /var/www/py/site2/site2/wsgi.py
  
  WSGIPythonPath /var/www/py/site1:/var/www/py/site2
  
  &lt;Directory "/var/www/py/site1/site1">
  &lt;Files wsgi.py>
  Order deny,allow
  Allow from all
  &lt;/Files>
  &lt;/Directory>
  
  &lt;Directory "/var/www/py/site2/site2">
  &lt;Files wsgi.py>
  Order deny,allow
  Allow from all
  &lt;/Files>
  &lt;/Directory>
  
  </pre>
  
  <p>Also here's the wsgi.py file for both applications</p>
  
  <pre>
  import os
  import sys
  
  path = '/var/www/py/site1'
  if path not in sys.path:
      sys.path.append(path)
  
  os.environ.setdefault("DJANGO_SETTINGS_MODULE", "site1.settings")
  from django.core.wsgi import get_wsgi_application
  application = get_wsgi_application()
  
  </pre>
  
  <p>Now, here's my problem. When I go to my server, let's say <a href="http://app1.sites.gr/site1" rel="noreferrer">http://app1.sites.gr/site1</a> it some times loads site1, and some other times it loads site2 !!!! The same goes when I visit  <a href="http://app1.sites.gr/site2" rel="noreferrer">http://app1.sites.gr/site2</a> ... Sometiems I get the welcome page for site1, sometimes I get the welcome page for site2 ! I am hitting F5 and getting different welcome pages. I have checked everything for the previous hours and did not find anything strange...</p>
  
  <p>Please, tell me what could be the problem before I go crazy ...</p>
  
  <p>Thanks ! </p>