[mod_python] Problem with PSP on mod_python 3.13

cagney siminone at ntlworld.com
Mon Apr 17 17:37:39 EDT 2006


I'm completely new to mod_python and everything has being going well
until I encountered PSP. I intend to only use PSP as a templating system
to keep HTML pages away from code.

The problem is that sometimes the PSP page appears and sometimes the
following error message appears.
                Mod_python error: "PythonHandler mod_python.publisher"
                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/mod_python/publisher.py", line 98, in handler
                  File "/usr/lib/python2.4/site-packages/mod_python/apache.py", line 457, in import_module
                    module = imp.load_module(mname, f, p, d)
                  File "/media/userarea/apache/psp_site/index.py", line 31, in ?
                    from mod_python import psp
                  File "/usr/lib/python2.4/site-packages/mod_python/psp.py", line 27, in ?
                    from cgi import escape
                ImportError: cannot import name escape
The strange thing is that when the refresh button is pressed the PSP
page appears. There are times when I have to goto the root ie
localhost/sandpit (alias) and continually press refresh until it works.
This is not browser related as I viewed file with both firefox and

To note my settings are as follows:
	 Python/2.4.2 Server 
	 localhost Port 80

The handlers I am using are as follows:

<Directory /media/userarea/apache/>
	Options +Indexes
	AllowOverride None
	AddHandler mod_python .py .py_
	PythonHandler mod_python.publisher
	PythonDebug On

I've checked apache's error.log and can only assume that the following
message occurs when it refreshes and displays page properly.

        Mon Apr 17 22:34:04 2006] [notice] mod_python: (Re)importing module 'index' with path set to '['/media/userarea/apache/psp_site']'
Has anyone encountered this before and know a solution.

Thanks in Advance


More information about the Mod_python mailing list