User_wsgi.py on dreamhost to get pylons

This is what I found to theoretically work from git hub.com-pylons-wsgi-example

import os, sys sys.path.append('/home/user/test.sample.com/Helloworld') os.environ['PYTHON_EGG_CACHE'] = '/home/user/tmp' from paste.deploy import loadapp def application(environ, start_response): environ['SCRIPT_NAME'] = environ['PATH_INFO'] application = loadapp('config:/home/user/test.sample.com/production.ini') return application(environ, start_response) 

Tried this on dreamhost and I get:

An error occurred while importing passenger_wsgi.py

I also tried the virtual environment, but it did not work either.

remember that after following the instructions i have python 2.6 but don't activate in the virtual directory.

Any ideas?

I also tried adding:

 from fcgi import WSGIServer 

and after def application:

 server = WSGIServer(application) server.run() 

But still get the same error. I'm sorry this was a little more visual, so I could debug passenger_content

+4
source share
1 answer

Finally found my answer:

 import os, sys INTERP = "/home/user/local/bin/python" if sys.executable != INTERP: os.execl(INTERP, INTERP, *sys.argv) sys.path.append('/home/user/test.sample.com/Helloworld') os.environ['PYTHON_EGG_CACHE'] = '/home/user/tmp' from paste.deploy import loadapp def application(environ, start_response): environ['SCRIPT_NAME'] = environ['PATH_INFO'] application = loadapp('config:/home/denat/test.sample.com/production.ini') return application(environ, start_response) 

The difference here is that the virtual environment was configured using pylons, but did not use it. From the wiki on dreamhost, I needed to add the following lines:

 INTERP = "/home/user/local/bin/python" if sys.executable != INTERP: os.execl(INTERP, INTERP, *sys.argv) 

Now I have an application for work pylons! Hooray!

I know that others have been looking for this, so I hope this helps them.

+4
source

All Articles