Could someone please explain to me the process of deploying a
0.9a2-based TurboGears app on Apache? I tried the version over at
http://www.turbogears.org/docs/deployment/mod_python.html
but that doesn't work. It bombs out with something along the lines of:
Mod_python error: "PythonHandler mpcp"
Traceback (most recent call last):
File "/usr/lib/python2.4/site-packages/mod_python/apache.py", line
299, in HandlerDispatch
result = object(req)
File "/usr/lib/python2.4/site-packages/mpcp-1.3-py2.4.egg/mpcp.py",
line 34, in handler
setup(options)
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 "/var/www/project/project_start.py", line 30, in ?
cherrypy.server.start()
File "/usr/lib/python2.4/site-packages/CherryPy-2.2.0rc1-py2.4.egg/cherrypy/_cpserver.py",
line 64, in start
Engine.start(self)
File "/usr/lib/python2.4/site-packages/CherryPy-2.2.0rc1-py2.4.egg/cherrypy/_cpengine.py",
line 91, in start
autoreload.main(self._start, freq=freq)
File "/usr/lib/python2.4/site-packages/CherryPy-2.2.0rc1-py2.4.egg/cherrypy/lib/autoreload.py",
line 63, in main
sys.exit(restart_with_reloader())
SystemExit: 2
Or if I remove cherrypy.server.start() from the last line of the
project_start.py script (as described on the aforementioned page) then
it bombs out with:
Mod_python error: "PythonHandler mpcp"
Traceback (most recent call last):
File "/usr/lib/python2.4/site-packages/mod_python/apache.py", line
299, in HandlerDispatch
result = object(req)
File "/usr/lib/python2.4/site-packages/mpcp-1.3-py2.4.egg/mpcp.py",
line 34, in handler
setup(options)
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])
ImportError: No module named py
So, um, how do I deploy a TurboGears 0.9a2 app with mod_apache?
The app I'm trying to deploy works fine running via cherrypy on both
my development comp and on the server I'm trying to deploy it on.
Any ideas or pointers as to how to deploy 0.9a2 stuff with mod_python?
Elver
Or, well, if there's no way to deploy a 0.9a2 TurboGears app with
mod_python, then are there any other options for getting this working
on Apache?
Elver
> Or, well, if there's no way to deploy a 0.9a2 TurboGears app with
> mod_python, then are there any other options for getting this working
> on Apache?
I'm using mod_proxy with Apache... There's a recipe on the Wiki.
--
Jorge Godoy <jgo...@gmail.com>
Thge mpcp script does not work (I believe) with 0.9a2. Check out
http://trac.turbogears.org/turbogears/wiki/ModPythonIntegration09 for
an example using modpython_gateway.py which I use on production.
Hope it helps,
Alberto
That works, sort of, but Catwalk decided to stop working.
I get a 500 internal error and in the logfile:
03/Apr/2006:17:20:13 HTTP INFO Page handler: <bound method
CatWalk.index of <turbogears.toolbox.catwalk.CatWalk object at
0xb74236ec>>
Traceback (most recent call last):
File "/usr/lib/python2.4/site-packages/CherryPy-2.2.0rc1-py2.4.egg/cherrypy/_cphttptools.py",
line 99, in _run
self.main()
File "/usr/lib/python2.4/site-packages/CherryPy-2.2.0rc1-py2.4.egg/cherrypy/_cphttptools.py",
line 248, in main
body = page_handler(*virtual_path, **self.params)
File "<string>", line 3, in index
File "/usr/lib/python2.4/site-packages/TurboGears-0.9a2-py2.4.egg/turbogears/controllers.py",
line 207, in expose
output = database.run_with_transaction(expose._expose,func,
accept, allow_json, allow_json_from_config,*args, **kw)
File "/usr/lib/python2.4/site-packages/TurboGears-0.9a2-py2.4.egg/turbogears/database.py",
line 216, in run_with_transaction
retval = func(*args, **kw)
File "<string>", line 5, in _expose
File "/usr/lib/python2.4/site-packages/TurboGears-0.9a2-py2.4.egg/turbogears/controllers.py",
line 228, in <lambda>
expose._expose.when(rule)(lambda _func, accept, allow_json,
allow_json_from_config,*args,**kw: _execute_func(
File "/usr/lib/python2.4/site-packages/TurboGears-0.9a2-py2.4.egg/turbogears/controllers.py",
line 246, in _execute_func
output = errorhandling.try_call(func, *args, **kw)
File "/usr/lib/python2.4/site-packages/TurboGears-0.9a2-py2.4.egg/turbogears/errorhandling.py",
line 59, in try_call
output = func(self, *args, **kw)
File "/usr/lib/python2.4/site-packages/TurboGears-0.9a2-py2.4.egg/turbogears/toolbox/catwalk/__init__.py",
line 1123, in index
return dict(models=self.models())
File "/usr/lib/python2.4/site-packages/TurboGears-0.9a2-py2.4.egg/turbogears/toolbox/catwalk/__init__.py",
line 1106, in models
return self.order_models(objs)
File "/usr/lib/python2.4/site-packages/TurboGears-0.9a2-py2.4.egg/turbogears/toolbox/catwalk/__init__.py",
line 763, in order_models
ordered = self.load_models_order()
File "/usr/lib/python2.4/site-packages/TurboGears-0.9a2-py2.4.egg/turbogears/toolbox/catwalk/__init__.py",
line 759, in load_models_order
state = self.load_state()
File "/usr/lib/python2.4/site-packages/TurboGears-0.9a2-py2.4.egg/turbogears/toolbox/catwalk/__init__.py",
line 619, in load_state
if not os.path.exists(self.state_path()): return {}
File "/usr/lib/python2.4/site-packages/TurboGears-0.9a2-py2.4.egg/turbogears/toolbox/catwalk/__init__.py",
line 607, in state_path
catwalk_session_dir =
os.path.join(turbogears.util.get_package_name(),'catwalk-session')
File "/usr/lib/python2.4/posixpath.py", line 62, in join
elif path == '' or path.endswith('/'):
AttributeError: 'NoneType' object has no attribute 'endswith'
What gives?
Elver