Welcome Guest | Login

CherryPy using mod_python

Hello!
Is it possible to use CherryPy with mod_python in a HostingRails account? I tried to do it but mod_python can't load libraries that are in my local account.

Thanks in advance

2007-06-24 10:40 PM

Hello,

Could you tell us the error message that you are getting ?

2007-06-24 11:29 PM

HostingRails Support
this is the message:

#####
Mod_python error: "PythonHandler cherrypy._cpmodpy::handler"

Traceback (most recent call last):

 File "/usr/local/lib/python2.4/site-packages/mod_python/apache.py", line 287, in HandlerDispatch
   log=debug)

 File "/usr/local/lib/python2.4/site-packages/mod_python/apache.py", line 461, in import_module
   f, p, d = imp.find_module(parts[i], path)

ImportError: No module named cherrypy
####

I've put the path to CherryPy on my PYTHONPATH, and also on .htaccess, this way:

#####
PythonPath "sys.path+['/home/myusername/myappfolder/']" #ficticious, if you need i'll send my username and complete path#
PythonOption mod_python.importer.path "['/home/freetin/lib/python2.4/site-packages;/home/myusername/lib/python2.4/']"
SetHandler python-program
PythonHandler cherrypy._cpmodpy::handler
PythonOption cherrypy.setup myapp::setup_server
PythonDebug On
#####

I think Apache don't find my CherryPy install because it uses its own path. If I try to import cherrypy in a python interactive session, it works. I thought the line mod_python.importer should fix it, but it isn't working yet...

2007-06-24 11:44 PM

Hello,

Could you please post a ticket to the support team with these errors so that we can look into this. Thank you

2007-06-25 02:01 AM

HostingRails Support

Hello Guest! In order to post you must be an active client with us, please log in or sign up today!