siminone at ntlworld.com
Mon Apr 17 18:28:50 EDT 2006
On Tue, 2006-04-18 at 07:49 +1000, Graham Dumpleton wrote: > Looks like somewhere on your web site, you or someone else has called a > mod_python handler cgi.py and it is being found before the standard > Python > cgi module. > > If it is someone else, use PythonInterpreter to specify a unique > interpreter > name just for your code area. > > These sorts of problems will hopefully be addressed in mod_python 3.3 > with > a new module importer. Also see: > > http://www.dscpl.com.au/articles/modpython-003.html > > Graham > > On 18/04/2006, at 7:37 AM, cagney wrote: > > > Hi > > > > 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 > > path=[path]) > > > > 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 > > konqueror. > > > > To note my settings are as follows: > > Apache/2.0.54 > > mod_python/3.1.3 > > 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 > > </Directory> > > > > 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 > > > > Al > > > > _______________________________________________ > > Mod_python mailing list > > Mod_python at modpython.org > > http://mailman.modpython.org/mailman/listinfo/mod_python > I had created several aliases that had different pythonhandlers when trying various examples. I have commented them out and everything is working fine now. Well, lesson learned!! I have too keep in mind the apache side of things as well as the programming parts. Thanks Graham for taking the time out to answer my query. Much appreciated. Al.