[mod_python] Access to apache namespace in PythonPath

Gustavo Córdova Avila gustavo.cordova at q-voz.com
Mon Nov 10 13:57:21 EST 2003


Gregory (Grisha) Trubetskoy wrote:

>On Mon, 10 Nov 2003, Michael S. Fischer wrote:
>
>  
>
>>Grisha,
>>
>>It would be really cool if we could get access to the apache namespace
>>in PythonPath, so we could do stuff like:
>>
>>PythonPath "sys.path + [apache.server_root() + '/py']"
>>    
>>
>That would be neat, but I'm not sure it's theoretically possible, not
>without some kind of trickery to simulate a run-time environment at
>configuration stage...
>
>I know mod_perl allows for inline perl to be executed at server
>configuration time - I haven't looked at that stuff and can't really say I know how it is done and whether it's something that would work with Python as well.
>
>Grisha
>
>  
>
Without wanting to sound flippy or anything like that, but, I don't see 
much sense in such a configuration-time parameter "automatization", 
because, setting such parameters is part of any deployment, it's better 
to keep things explicit, no?

I'd prefer to use module-level variables-as-constants, with BIG 
UPPERCASE names, so as to not miss them when deploying, or updating, a 
module.

Just my thoughts.

-gustavo




More information about the Mod_python mailing list