2

I'm trying to setup Django on a shared hosting provider, Dreamhost. When serving a Django project, Passenger WSGI is used. This works with Dreamhost's default python, but is unable to find the modules in my virtualenv.

I changed my passenger_wsgi.py to include:

INTERP = "/home/<username>/.pythonbrew/venvs/Python-2.7.3/<venv>/bin/python"
if sys.executable != INTERP: os.execl(INTERP, INTERP, *sys.argv)

(as documented on http://wiki.dreamhost.com/Passenger_WSGI)

This breaks the site with a generic Internal Server Error. My Dreamhost log file doesn't provide much additional help: Premature end of script headers: internal_error.html.

How can I configure Passenger to find the Python modules installed in my virtualenv?

knite
  • 6,033
  • 6
  • 38
  • 54

1 Answers1

1

Try add your virtualenv site-packages on your sys.path after you change your INTERP.

import sys
sys.path.insert(0, '/path/to/venv/site-packages')

this is working with me

Ezequiel Bertti
  • 810
  • 8
  • 15