By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
445,876 Members | 1,191 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 445,876 IT Pros & Developers. It's quick & easy.

MOD_PYTHON + packages reloading

P: n/a
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 :)

Oct 18 '07 #1
Share this Question
Share on Google+
1 Reply


P: n/a
lu********@gmail.com wrote:
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.
Have you read the mod_python manual?

http://www.modpython.org/live/curren...other-par.html

5.4.8 PythonAutoReload

Syntax: PythonAutoReload {On, Off}
Default: PythonAutoReload On
Context: server config, virtual host, directory, htaccess
Override: not None
Module: mod_python.c

If set to Off, instructs mod_python not to check the modification date
of the module file.

By default, mod_python checks the time-stamp of the file and reloads the
module if the module's file modification date is later than the last
import or reload. This way changed modules get automatically reimported,
eliminating the need to restart the server for every change.

Disabling autoreload is useful in production environment where the
modules do not change; it will save some processing time and give a
small performance gain.

Oct 18 '07 #2

This discussion thread is closed

Replies have been disabled for this discussion.