[mod_python] PythonAutoReload?

Malcolm Lockyer maxp at orcon.net.nz
Mon Aug 23 16:40:48 EDT 2004

Hi All (again),

Thanks for the quick replies to my previous dumb question!

In my mod_python application I intend to load several modules from a 
package. It seems that at the moment when I import the module it stays 
in memory, even when I change and save it.

Example -
from mod_python import apache
from application import Authentication

def handler :
    req.content_type = "text/html"
    if Authentication.check() == 1 :
       req.write("You are authenticated")
    else :
       req.write("You aren't authenticated!")
    return apache.OK

(Authentication.py inside application folder)
def check() :
    return 1

That is all fine and dandy, but when I change it to return 0 - the 
output doesn't change. I just assume that on first import it compiles 
the bytecode and keeps it. When I re-start apache it changes, but 
doesn't change again. This is annoying during development (since its 
changing all the time).

I noticed the PythonAutoReload directive, even though it defaults to on, 
I added it to my .htaccess with no change. Also there isn't just a .pyc 
in the application folder I can delete.

Any ideas would be appreciated....
(sorry if this is *really* dumb!)


More information about the Mod_python mailing list