Eric Larson
Eric Larson

Reputation: 35

Passenger + Dreamhost + Django Error

Web application could not be started

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

Directories: username/root/env username/root/appname username/root/public username/root/static username/root/tmp username/root/passenger_wsgi.py username/root/passenger_wsgi.pyc

Passenger_Wsgi.py import sys, os INTERP = "/home/larson07/local/bin/python" #INTERP is present twice so that the new python interpreter knows the actual executable path 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()

Thank you in advance! -E

Upvotes: 1

Views: 527

Answers (1)

Colin Ricardo
Colin Ricardo

Reputation: 17249

Your INTERP is likely pointing to the wrong place. To fix this, type which python into your terminal, and use the resulting filepath as the INTERP. This worked for me!

Upvotes: 1

Related Questions