[mod_python] publisher handler questions

Jon-Pierre Gentil jgentil at sebistar.net
Mon Sep 12 18:50:47 EDT 2005

On Monday 12 September 2005 03:26 pm, akonsu wrote:

> > An underscore will prevent direct access:
> >  def _foo():
> would not this be accessible through http://host/test.py/_foo ?

Nope, mod_python.publisher blocks that.

> > > 2. in my .py file (that is invoked through the publisher handler
> > > again) i define some global variables. i noticed that these
> > > variables are initialised once. is this by design or just a
> > > coincidence? can i rely on this behaviour?
> >
> > It depends. A database or other persistent storage mechanism may be
> > more reliable.
> i am not talking about saving user data that should go in to sessions
> in global variables. i need a list of files in a particular directory,
> and i am trying to avoid building this list on every single http
> request. what is the right strategy for handling something like this?

mod_python global variables vary by a lot of different things.  Thus they 
are unreliable to use.


  Jon-Pierre Gentil               PGP: 0x7E1CBA17
  jabber: jgentil at sebistar.net    web: www.sebistar.net
  "If you think education is expensive, try ignorance."
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 827 bytes
Desc: not available
Url : http://mm_cfg_has_not_been_edited_to_set_host_domains/pipermail/mod_python/attachments/20050912/8e338edc/attachment.bin

More information about the Mod_python mailing list