How can I tell Phusion Passenger which python to use?

Posted by Mike on Stack Overflow See other posts from Stack Overflow or by Mike
Published on 2010-05-16T01:53:52Z Indexed on 2010/05/16 2:00 UTC
Read the original article Hit count: 225

Filed under:
|
|
|
|

I'm using Phusion Passenger with a ruby app and I'd also like to set it up to work with an django appengine app I'm working on.

Googling for "passenger_wsgi.py" I was able to get the following very simple non-django app working on passenger:

passenger_wsgi.py:

def application(environ, start_response):
   response_headers = [('Content-type','text/plain')]
   start_response('200 OK', response_headers)
   return ['Hello World!\n']

However, if I add the line import django.core.handlers.wsgi into the mix, I get 'An error occurred importing your passenger_wsgi.py'. By printing out the sys.path I've discovered that at least part of the reason is because Passenger is using the wrong python installation on my machine.

How can I configure Passenger (on apache) to use /opt/local/bin/python2.5 instead of the system default python?

© Stack Overflow or respective owner

Related posts about passenger

Related posts about python