Passenger + Dreamhost + Django错误

时间:2015-09-23 04:28:00

标签: django passenger

无法启动Web应用程序

Traceback (most recent call last):
  File "/dh/passenger/helper-scripts/wsgi-loader.py", line 320, in <module>
    app_module = load_app()
  File "/dh/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 "/usr/lib/python2.7/os.py", line 312, in execl
    execv(file, args)
OSError: [Errno 2] No such file or directory

目录: 用户名/根/ env的 用户名/根/应用程序的名字 用户名/根/公共 用户名/根/静态 用户名/根/ TMP 用户名/根/ passenger_wsgi.py 用户名/根/ passenger_wsgi.pyc

Passenger_Wsgi.py     import sys,os     INTERP =&#34; / home / larson07 / local / bin / python&#34;     #INTERP出现两次,以便新的python解释器知道实际的可执行路径     if sys.executable!= INTERP:os.execl(INTERP,INTERP,* sys.argv)

cwd = os.getcwd()
sys.path.append(cwd)
sys.path.append(cwd + '/poll')  #You must add your project here

sys.path.insert(0,cwd+'/env/bin')
sys.path.insert(0,cwd+'/env/lib/python2.7/site-packages/django')
sys.path.insert(0,cwd+'/env/lib/python2.7/site-packages')

os.environ['DJANGO_SETTINGS_MODULE'] = "poll.settings"
from django.core.wsgi import get_wsgi_application
application = get_wsgi_application()

提前谢谢! -E

1 个答案:

答案 0 :(得分:1)

您的INTERP可能指向错误的地方。要解决此问题,请在终端中键入which python,并将生成的文件路径用作INTERP。这对我有用!