[mod_python] mod_python weirdness, maybe related to importing?

StianSøiland stian at soiland.no
Mon Jul 7 18:19:49 EST 2003


On 1970-01-01 01:00:00, Sean Reifschneider wrote:

> Also, I'm running into cases where I'm setting values within modules in
> my handler, and then when I call code in the module those values are
> reset.  I've resorted to shoving request-persistent data into
> __builtins__, which works around the latter problem, and re-structuring
> some code so that my entire object heirarchy *CAN* be imported all at
> once.

Btw, a good tip to store some info from here to there is to store them
as attributes in the req object. We've created req.session by loading it
in the PythonFixupHandler mentioned in an earlier post, req.session is
available to all subsequent request handlers.

(and in some cases, weird enough, after the request is finished, the
attribute still remains in req.session for the NEXT call.. leading
to..
  
  def fixuphandler(req):
      req.session = None
)




-- 
Stian Søiland               Work toward win-win situation. Win-lose
Trondheim, Norway           is where you win and the other lose.
http://www.soiland.no/      Lose-lose and lose-win are left as an
                            exercise to the reader.  [Limoncelli/Hogan]



More information about the Mod_python mailing list