|
Graham Dumpleton
grahamd at dscpl.com.au
Thu Oct 6 18:19:54 EDT 2005
Haven't properly sat down and tried to work through the emails on this yet, but as to setting up a basic mptest.py example, you might also read: http://www.dscpl.com.au/articles/modpython-001.html This may give you a bit more insight into what certain things are for and how to sort out problems. As Nicolas said, a basic handler and mod_python.publisher are different things and you seem to be confusing the two at this point. More later. Graham On 07/10/2005, at 4:35 AM, Nicolas Lehuen wrote: > Hi Ken, > > Unfortunately for a lot of mod_python beginners, it is not clear why > the mptest handler CANNOT be used directly by the publisher handler. > > First of all, try to have the publisher running as described here : > http://www.modpython.org/live/current/doc-html/tut-pub.html > > Then, you'll understand that even if the publisher is correctly > configured, if you call /mod_python/mptest.py, then the publisher > handler will find the mptest module but NOT an index(req) function > inside... You'll have to call /mod_python/mptest.py/handler to specify > the function to call (or rename handler to index) and begin to solve > your 404 problem. > > Last, but not least, handlers are supposed to write on the request > object and return a status value (hence the return apache.OK), whereas > the return value of published functions is the data you want to send > back to the client (though you can also write on the request object to > make things more interesting). > > To sum up, handlers are the lowest API of mod_python, and the > publisher is just a handler which has its own system for publishing, > which somewhat resembles the handler system, but with enough > differences to prevent the two from being swappable at will... We know > it's quite confusing for a newbie, but now that there are users for > the two layers, we can't unify them :). > > Regards, > Nicolas > > 2005/10/6, Ken Bradshaw <bradshak at us.ibm.com>: > > > > > > Hello All, > > I've recently taken an interest in python and mod_python in > particular. For > > the past two years or so I've been developing enterprise web apps in > j2ee > > with WebSphere Applications Server and Portal Server, so I'm pretty > used to > > pouring over documentation when configuration issues arise. |