无法在乘客wsgi上启动应用程序

时间:2015-09-10 10:18:27

标签: python django passenger

我尝试在django 1.3和passsenger wsgi上运行古老的应用程序。

我的passenger_wsgi.py是:

import sys, os
INTERP = sys.path.append(os.path.join(os.getcwd(), 'myvenv/bin/python')) 
if sys.executable != INTERP: os.execl(INTERP, INTERP, *sys.argv)
sys.path.append(os.getcwd())
os.environ['DJANGO_SETTINGS_MODULE'] = 'myapp.settings'
import django.core.handlers.wsgi
application = django.core.handlers.wsgi.WSGIHandler()

我收到下一个错误:

Raw process output:

Traceback (most recent call last):
  File "/opt/passenger/helper-scripts/wsgi-loader.py", line 320, in <module>
    app_module = load_app()
  File "/opt/passenger/helper-scripts/wsgi-loader.py", line 61, in load_app
    return imp.load_source('passenger_wsgi', startup_file)
  File "passenger_wsgi.py", line 4, in <module>
    if sys.executable != INTERP: os.execl(INTERP, INTERP, *sys.argv)
  File "/home/gian/virtualenv/public__html_test_gian/2.7/lib64/python2.7/os.py", line 314, in execl
    execv(file, args)
TypeError: coercing to Unicode: need string or buffer, NoneType found

编辑:

我更改了右'/home/gian/public_html/test/gian/myvenv/bin/python'

上的INTERP变量

现在我接下来:

'Traceback (most recent call last):
  File "/opt/passenger/helper-scripts/wsgi-loader.py", line 320, in <module>
    app_module = load_app()
  File "/opt/passenger/helper-scripts/wsgi-loader.py", line 61, in load_app
    return imp.load_source('passenger_wsgi', startup_file)
  File "passenger_wsgi.py", line 4, in <module>
    if sys.executable != INTERP: os.execl(INTERP, INTERP, *sys.argv)
  File "/home/gian/virtualenv/public__html_test_gian/2.7/lib64/python2.7/os.py", line 314, in execl
    execv(file, args)
OSError: [Errno 13] Permission denied'

0 个答案:

没有答案