[mod_python] PythonAutoReload?

Gregory (Grisha) Trubetskoy grisha at modpython.org
Mon Aug 23 13:59:36 EDT 2004



On Mon, 23 Aug 2004, Fabio Rotondo wrote:

>
> As far as I can tell, there are two kind of files those you'll be pretty sure 
> mod_python will reload and those you wont.
> For example, in my app, I have some code that goes inside 
> /usr/lib/python/site-packages/(mydir)
> These files are *not* reloaded by mod_python and when I change them I have to 
> restart apache in order to see the changes.

unless you import them using apache.import_module() :-)

> You have to restart Apache only while you are developing. I know this 
> can be annoying, but it is the only *safe* way I found out to be sure 
> that what you write is what you get :-)

Exactly. The Python docs for the reload() function are pretty clear that 
there are caveats, such as that the module's dictionary of global 
variables persists throughout reloads.

Grisha


More information about the Mod_python mailing list