mod_python, multiple calls to PythonAuthenHandler

Rune Hansen rune.hansen at
Mon Nov 8 10:08:49 CET 2004

I've posted this question on the mod_python mailing list but didn't get 
much response, so I thought I'd post it here.

(My first attempt connected to an unrelated thread..sorry.

It seems to me that for each path element in a URI a mod_python handler
will be invoked. This applies to PythonAuthenHandler,
PythonHeaderParserHandler and so on.

Since I'm making a database request in my PythonAuthenHandler, this 
quickly becomes a problem.

Example: =>
	AuthenHandler::authenhandler called: 1
	index got called once =>
	AuthenHandler::authenhandler called: 1
	AuthenHandler::authenhandler called: 2
	/search got called once => (using mod_rewrite)
	AuthenHandler::authenhandler called: 1
	AuthenHandler::authenhandler called: 2
	AuthenHandler::authenhandler called: 3
	/search got called once

I get the same behavior on three separate installations

So, either I've got a miss-configuration which results in multiple calls 
to handlers or.., this is expected behavior, and there is a technique to 
avoid this or..., this is expected and, for reasons that escapes me, 
desired behavior.

I'd greatly appreciate any help and suggestion



More information about the Python-list mailing list