3

I have two websites hosted on the same machine. Both of them are developed using Django 1.3.

Now I need to move one site (website1) to the latest version of Django i.e. 1.5

Is it possible to do this? How should I set up the sites so that both work seamlessly?

2 Answers2

9

virtualenv package will help:

virtualenv is a tool to create isolated Python environments.

It's somewhat tricky to activate virtualenv in the wsgi file, but there is a lot of info on the subject out there:

Community
  • 1
  • 1
alecxe
  • 462,703
  • 120
  • 1,088
  • 1,195
3

Yes, use virtualenv, and in your wsgi script add this:

import os, sys    
sys.path.insert(0, '/path/to/mysite') #where your site is
activate_this = '/path/to/djangoenv/bin/activate_this.py' #virtualenv with proper Django version
execfile(activate_this, dict(__file__=activate_this))
from django.core.wsgi import get_wsgi_application
application = get_wsgi_application()
adamr
  • 740
  • 6
  • 18