Created
June 17, 2016 04:53
-
-
Save mpwoodward/3b446e573eb7b4d6f758c291c06f607e to your computer and use it in GitHub Desktop.
Example passenger_wsgi.py file for running a Django application on Dreamhost with Passenger
This file contains 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 sys, os | |
cwd = os.getcwd() | |
sys.path.append(cwd) | |
sys.path.append(cwd + '/my_django_project') | |
INTERP = os.path.expanduser("~/.virtualenvs/my_django_project/bin/python3") | |
if sys.executable != INTERP: os.execl(INTERP, INTERP, *sys.argv) | |
sys.path.insert(0,'$HOME/.virtualenvs/my_django_project/bin') | |
sys.path.insert(0,'$HOME/.virtualenvs/my_django_project/lib/python3.5/site-packages/django') | |
sys.path.insert(0,'$HOME/.virtualenvs/my_django_project/lib/python3.5/site-packages') | |
os.environ['DJANGO_SETTINGS_MODULE'] = 'my_django_project.settings' | |
from django.core.wsgi import get_wsgi_application | |
application = get_wsgi_application() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment