Apache Mod-Python - Re: [Mod_python Wiki] Update of "MostMinimalRequestHandler" by JoreyBump

This is Interesting: Free IT Magazines  
Home > Archive > Apache Mod-Python > December 2006 > Re: [Mod_python Wiki] Update of "MostMinimalRequestHandler" by JoreyBump





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author Re: [Mod_python Wiki] Update of "MostMinimalRequestHandler" by JoreyBump
Jim Gallacher

2006-12-02, 1:11 pm

Apache Wiki wrote:
> Dear Wiki user,
>
> You have subscribed to a wiki page or wiki category on "Mod_python Wiki" for change notification.
>
> The following page has been changed by JoreyBump:
> http://wiki.apache.org/mod_python/M...lRequestHandler
>
> ------------------------------------------------------------------------------
>
> Let's begin at the beginning. Here is the most minimal request handler possible:
>
> + {{{
> def handler(req):
> return 0
> + }}}


FYI, you can get Python syntax highlighting by starting your code block
with {{{#!python

Also I would avoid using "return 0". I know you want it to be the most
minimal handler possible, but I think it's better to encourage good
coding habits by using "return apache.OK". It will then be more logical
when users move on to more sophisticated handlers, perhaps in other
phases, where the handler may be returning something other than 0.

Jim

Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com