I want to deploy two different Django apps in the same host with the different virtual environment (python2.7 and python 3.6). I had followed the tutorial https://www.thecodeship.com/deployment/deploy-django-apache-virtualenv-and-mod_wsgi/ to deploy. one of my WSGI scripts is
import os
import sys
import site
site.addsitedir('~/.virtualenvs/myprojectenv/local/lib/python2.7/site-packages')
sys.path.append('/home/django_projects/MyProject')
sys.path.append('/home/django_projects/MyProject/myproject')
os.environ['DJANGO_SETTINGS_MODULE'] = 'myproject.settings'
activate_env=os.path.expanduser("~/.virtualenvs/myprojectenv/bin/activate_this.py")
execfile(activate_env, dict(__file__=activate_env))
import django.core.handlers.wsgi
application = django.core.handlers.wsgi.WSGIHandler()
when I run apache server I get an error ---> Nameserver: name 'execfile' is not defined
When I searched for this error I found execfile is not supported in Python 3.X. But I have 2 Django app to deploy. Please help me to find the solution. Is there any detail you need let me know