[mod_python] Q : persistent objects/vars

thepoet at texas.net thepoet at texas.net
Tue Nov 21 08:21:25 EST 2000


I've sifted through all the relevant documentation
and the mailing list archives, so please excuse this
email if there happens to be any repitition.

As I understand it, when the apache server starts up,
python is called and the directory in which I've placed
my files receives a subinterpreter.  In attempting to
persist an object, would it be as simple as making a
variable 'global' (would all processes know of the global
no matter what since it is in the same subint and that
subint is persistent across processes?), or must
I attempt to use one of the funcs from the apache module
itself like req (which according to the list is now a persistent
python object).  And if I were to use req, how would I
make sure that every instance of my script that is handled
by the subint can r-w that variable (say, a list of items)
and might there be an example of how to do this?  (I have
tried globals and req. without much luck). Thanks
in advance for any help you might be able to offer...and
kudos to the mod_python authors!

-Rick




More information about the Mod_python mailing list