[mod_python] import module behaviour ?!

Gregory (Grisha) Trubetskoy grisha at modpython.org
Mon May 3 22:53:25 EST 2004


Instead of using

  import somemodule

try using

  from mod_python import apache

  somemodule = apache.import_module('somemodule')

Then it will be reloaded automatically every time somemodule.py changes.

HTH,

Grisha


On Mon, 3 May 2004, Nicolescu Lucian wrote:

> hi there,
>
> I am a new into mod_python and there is a strange thing I noticed:
> I use import <somefile_from_current_dir> to have access to some global
> variables I need in my application (so I don't have to reinitialize it again
> in another file)
> the thing is that if I make any changes in <somefile_from_current_dir> they
> will not be noticed until I restart apache
> is there another way around this ?
>
> btw: I use: apache 2.0.48, python 2.3.3, mod_python 3.1.3 !
>
> 10x,
> Nicolescu Lucian
>
> _______________________________________________
> Mod_python mailing list
> Mod_python at modpython.org
> http://mailman.modpython.org/mailman/listinfo/mod_python
>


More information about the Mod_python mailing list