Mod_python error: "PythonHandler mpcp"
[...]
File "/usr/lib/python2.4/site-packages/mpcp-1.3-py2.4.egg/mpcp.py",
line 18, in setup
mod = __import__(modname, globals(), locals(), [fname])
File "/my/path/start_site.py", line 5, in ?
import turbogears
File
"/usr/lib/python2.4/site-packages/TurboGears-0.9a4-py2.4.egg/turbogears/__init__.py",
line 5, in ?
from turbogears import config
ImportError: cannot import name config
My current .htaccess is this:
SetEnv PYTHON_EGG_CACHE=/tmp/my-eggs
SetHandler mod_python
PythonHandler mpcp
PythonDebug On
PythonOption cherrysetup start_site::mp_setup
Since the code triggering this bug is in TurboGears, we can say
TurboGears needs at least mod_python 3.2.7. Shouldn't this be mentioned
in the docs?
As a former mod_python + TG user i'd recommend you to follow the
masses and set up an Apache proxy and keep cherrypy running with
supervisord. I'd save you many troubles, specially if running a
worker MPM since mod_python seems to have a threading bug regarding
multiple interpreters.
I can even feel my apps faster this way :)
Alberto
mod_python essentially is broken. So why does TurboGears advertise it?
Because everybody does?
Good :)
> mod_python essentially is broken. So why does TurboGears advertise it?
> Because everybody does?
I don't see it as an advertisement, it just happens that you *can*
actually deploy it there so the docs state it. My impression is
however that the *recommended* way is through a proxy.
I'm pretty sure older versions of mod_python in apache1 have no
problems, however, 2.4 is recommended for TG as it does heavy use of
some of it's new features (decorators or threadlocal in CP, for
example).
Regards,
Alberto
Take a look at the wiki. And use turbogears.redirect() instead of
cherrypy.HTTPRedirect(turbogears.url()) ;-)
I recommend using mod_proxy instead of mod_rewrite since it is much easier to
setup.
--
Jorge Godoy <jgo...@gmail.com>