我怎么能告诉Phusion的乘客要使用的蟒蛇? [英] How can I tell Phusion Passenger which python to use?
问题描述
我使用的Phusion客运与红宝石应用程序,我也想设置它与Django的AppEngine上的应用程序我正在努力工作。
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.
谷歌搜索passenger_wsgi.py我能得到以下非常简单的非Django应用程序客运工作:
Googling for "passenger_wsgi.py" I was able to get the following very simple non-django app working on passenger:
passenger_wsgi.py:
passenger_wsgi.py:
def application(environ, start_response):
response_headers = [('Content-type','text/plain')]
start_response('200 OK', response_headers)
return ['Hello World!\n']
不过,如果我添加行进口django.core.handlers.wsgi
混进去,我得到出错导入您的passenger_wsgi.py。通过打印sys.path中我发现,原因至少有一部分是因为乘客是用我的机器上的Python安装错了。
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.
我怎么可以配置客运(基于Apache),以使用 /opt/local/bin/python2.5
而不是系统默认的Python?
How can I configure Passenger (on apache) to use /opt/local/bin/python2.5
instead of the system default python?
推荐答案
我发现,如果我在乘客的第一行改变了hashbang request_handler.py
文件到#!/选择/ local / bin目录/的python2.5
,乘客使用正确的蟒蛇。但肯定要有比修改乘客分布的更好的办法?
I discovered that if I changed the hashbang at the first line of passenger's request_handler.py
file to #!/opt/local/bin/python2.5
, passenger used the correct python. But surely there must be a better way than modifying passenger's distribution?
这篇关于我怎么能告诉Phusion的乘客要使用的蟒蛇?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!