[mod_python] PythonOption access

Graham Dumpleton grahamd at dscpl.com.au
Thu Jan 20 17:47:41 EST 2005

Robert Brewer wrote ..
> Bo Lorentsen wrote:
> > Will it be possible to access PythonOptions like log_error in a more
> > global context (log_error is a function on the apache 
> > module), so that 
> > global values can get there init value on module init and NOT on the
> > first incomming request ? I have some code that work around this, but
> > its not pretty, and I like things to be so, and I don't 
> > understand why 
> > it has to be a method on the request module.
> > 
> > Is this completely impossible ?
> Not at all. Use the PythonImport directive to load a "global" module
> when Apache starts, and have that module inspect and preserve
> PythonOption values.

Hmmm, to access any options at this point would be dependent on
using the apache.config_tree() method. In that case, he could access
that from any module as part of the init of the module being loaded
and wouldn't have to use PythonImport.

Forgot about apache.config_tree() when I made my last post, probably
because I never use it, preferring to do everything in .htaccess files
instead. Not even sure what it returns. :-)

    Returns the server-level configuration tree. This tree does not
    include directives from .htaccess files. This is a copy of  the tree,
    modifying it has no effect on the actual configuration.


More information about the Mod_python mailing list