[mod_python] from mod_python import apache

Nic Ferrier nferrier at tapsellferrier.co.uk
Fri Aug 20 01:53:37 EDT 2004


Iker Arizmendi <iker at research.att.com> writes:

> What I meant is that I'd like to have the req
> object globally available within the module
> as it is within PSP pages.
> 
> Any way to do that?

How about:


req_object = None

def handler(req):
        global req_object
        req_object = req
        make_some_call()
        return None

def make_some_call():
        global req_object
        req_object.content_type = "text/plain"
        return None



-- 
Nic Ferrier
http://www.tapsellferrier.co.uk


More information about the Mod_python mailing list