【问题标题】:Passenger + Dreamhost + Django Error乘客 + Dreamhost + Django 错误
【发布时间】:2015-09-23 04:27:59
【问题描述】:

无法启动 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

目录: 用户名/root/env 用户名/root/appname 用户名/根/公共 用户名/根/静态 用户名/root/tmp 用户名/root/passenger_wsgi.py 用户名/root/passenger_wsgi.pyc

Passenger_Wsgi.py 导入系统,操作系统 INTERP = "/home/larson07/local/bin/python" #INTERP 出现两次,以便新的 python 解释器知道实际的可执行路径 如果 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

【问题讨论】:

    标签: django passenger


    【解决方案1】:

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

    【讨论】:

      猜你喜欢
      • 2014-07-06
      • 1970-01-01
      • 2011-05-14
      • 1970-01-01
      • 1970-01-01
      • 2023-03-21
      • 2016-11-12
      • 2022-08-19
      • 2012-06-12
      相关资源
      最近更新 更多