-
-
Save Joevdwalt/f7c2774efe7470eba61129f954b07ca7 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
import sys | |
import site | |
# Add the site-packages of the chosen virtualenv to work with | |
site.addsitedir('~/.virtualenvs/myprojectenv/local/lib/python2.7/site-packages') | |
# Add the app's directory to the PYTHONPATH | |
sys.path.append('/home/django_projects/MyProject') | |
sys.path.append('/home/django_projects/MyProject/myproject') | |
os.environ['DJANGO_SETTINGS_MODULE'] = 'myproject.settings' | |
# Activate your virtual env | |
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() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment