projectname = 'myproject' virtualenv_root = '/var/www/my.server.ru/env/' import sys import os sys.path.append(os.path.join(os.getcwd(), projectname)) from django.core.wsgi import get_wsgi_application os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'myproject.settings') application = get_wsgi_application()