I have two sites build on Django, both of them use gunicorn
managed with supervisor 2
supervisord.conf:
[program:site1]
environment=PYTHONPATH="/home/www/virtualenv/site1/bin/:/home/www/site1/"
command=/home/www/virtual/site1/bin/gunicorn wsgi:app -b localhost:1234
directory=/home/www/site1/
...
[program:site2]
environment=PYTHONPATH="/home/www/virtualenv/site2/bin/:/home/www/site2/"
command=/home/www/virtual/site2/bin/gunicorn wsgi:app -b localhost:1235
directory=/home/www/site2/
...
With this configuration I noticed that site2 tries to start with settings of site1, and fails because it cant find packages that required for site1, because they are not installed in virtualenv of site2.
I think that it happens because of PYTHONPATH
mixes between two sites.
How to properly setup both sites to use only own virtualenv?