[code helloworld.fcgi]
#!/usr/local/bin/python
import sys
# Add a custom Python path (where pylons and everything else is
installed)
sys.path.insert(0, "/home/<myuser>/lib/python2.4/site-package")
# Load the WSGI application from the config file
from paste.deploy import loadapp
wsgi_app = loadapp('config:/home/<myuser>/pylons_projects/helloworld/
development.ini')
# Deploy it using FastCGI
if __name__ == '__main__':
from flup.server.fcgi import WSGIServer
WSGIServer(wsgi_app).run()
[/code]
and then...
~/www/pylons> python helloworld.fcgi
Traceback (most recent call last):
File "helloworld.fcgi", line 9, in ?
wsgi_app = loadapp('config:/home/<myuser>/pylons_projects/
helloworld/development.ini')
File "/home/<myuser>/lib/python2.4/site-packages/PasteDeploy-1.3-
py2.4.egg/paste/deploy/loadwsgi.py", line 193, in loadapp
return loadobj(APP, uri, name=name, **kw)
File "/home/<myuser>/lib/python2.4/site-packages/PasteDeploy-1.3-
py2.4.egg/paste/deploy/loadwsgi.py", line 213, in loadobj
global_conf=global_conf)
File "/home/<myuser>/lib/python2.4/site-packages/PasteDeploy-1.3-
py2.4.egg/paste/deploy/loadwsgi.py", line ...(more errors)...
562, in find_egg_entry_point
pkg_resources.require(self.spec)
File "/home/<myuser>/lib/python2.4/site-packages/setuptools-0.6c6-
py2.4.egg/pkg_resources.py", line 626, in require
needed = self.resolve(parse_requirements(requirements))
File "/home/<myuser>/lib/python2.4/site-packages/setuptools-0.6c6-
py2.4.egg/pkg_resources.py", line 524, in resolve
raise DistributionNotFound(req) # XXX put more info here
pkg_resources.DistributionNotFound: helloworld
You need to install your pylons app via easy_install, the easiest way
of doing this is to run
python setup.py develop
on your app. An alternative to installing it is explicitly telling
setuptools where to find it via:
import pkg_resources
pkg_resources.working_set.add_entry('/pathto/yourapp')
Also I can see you're customizing your sys.path for your app. You
might want to use workingenv or virtual-python instead of doing this
yourself, as they can make this easier
--
Philip Jenvey