MOD_PYTHON + packages reloading

lukasz.f24 at gmail.com lukasz.f24 at gmail.com
Thu Oct 18 04:06:06 EDT 2007


Hello,

I came across annoying problem during my fun with mod_python. I turned
out that mod_python load package only onca and don't care about any
changes to it. Obviously it makes sense on production server but
during development is more then annoying. I find a way to reload my
module:

    m = apache.import_module(name)
    reload(m)

But this solution doesn't satisfy my. Is there any way to use old good
import x.x.x or from x.x.x import y and somehow set mod_python to
autoreload packages? apache.import_module(name,autoreload=1) didn't
work.
What is more interesting if a file is in the same directory (no in the
package) i don't need to wory about reloading, python doesn't cache
it.

Please help me :)




More information about the Python-list mailing list