cannot import name config

610 views
Skip to first unread message

beza1e1

unread,
Apr 20, 2006, 11:38:22 AM4/20/06
to TurboGears
TurboGears is running through mod_python/mpcp and gives me this error:

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

beza1e1

unread,
Apr 21, 2006, 9:01:05 AM4/21/06
to TurboGears
I think this is a bug in mod_python:
http://issues.apache.org/jira/browse/MODPYTHON-12

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?

beza1e1

unread,
Apr 21, 2006, 9:41:34 AM4/21/06
to TurboGears
Neither SuSE nor
Debian nor Gentoo provide mod_python 3.2.* ... how do you guys run
TurboGears with mod_python???

Alberto Valverde

unread,
Apr 21, 2006, 1:07:10 PM4/21/06
to turbo...@googlegroups.com

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

beza1e1

unread,
Apr 22, 2006, 5:38:39 PM4/22/06
to TurboGears
Thanks for your advice, now app is online now! :-) (dreffen.de but
nothing to see there)

mod_python essentially is broken. So why does TurboGears advertise it?
Because everybody does?

Alberto Valverde

unread,
Apr 22, 2006, 6:05:53 PM4/22/06
to turbo...@googlegroups.com

On 22/04/2006, at 23:38, beza1e1 wrote:
> Thanks for your advice, now app is online now! :-) (dreffen.de but
> nothing to see there)

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

beza1e1

unread,
Apr 23, 2006, 6:26:09 PM4/23/06
to TurboGears
Now my App runs on Port 8080 and Apache on Port 80 is a RewriteRule
Proxy. The problem a "raise HTTPRedirect" leads to the Port 8080
Version. This works as long as this Port is open but how can i tell
TurboGears/Cherrypy to use another host:port ?

Jorge Godoy

unread,
Apr 23, 2006, 6:53:18 PM4/23/06
to turbo...@googlegroups.com

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>

Reply all
Reply to author
Forward
0 new messages