[mod_python] Must restart apache for recompile?

Mike Looijmans nlv11281 at natlab.research.philips.com
Wed May 31 03:32:48 EDT 2006


It may not be the prettiest, but a restart is surely the most stable way to do this. It's only a 
sighup on most systems anyway.

In a previous project, I had a "secret" reload page, that tried to flush out all my modules from the 
sys.modules list, by calling reload() for each one, something like:

for modul in sys.modules:
   if "/myapp/" in modul.__file__:
     reload(modul)

I don't recall the exact semantics (the code above probably won't really work).

As an alternative, grab the latest mod_python and give Graham's new module loader a workout. That 
ought to fix it properly.

Mike Looijmans
Philips Natlab / Topic Automation


drs. Slinger Jansen wrote:
> *newbie* Hi there,
> 
> I have recently installed mod_python and I'm trying to fight through the 
> steep learning curve of SOAP interfaces.
> 
> Got my first sample program running now, but I need to restart Apache 
> each time I wish to recompile my apps. I cannot believe that that's the 
> way to go. Currently I have three .py files, a "MyHandler.py", a 
> "client.py" and a "server.py". client.py calls the server, which imports 
> myhandler. MyHandler and server are never recompiled when accessed from 
> client.py. Client.py of course is recompiled each time I run it (using 
> python client.py).
> 
> I'm confused, shouldn't server.py (and in turn MyHandler.py) be 
> recompiled each time I access them from client.py? I need this for 
> development.
> 
> Slinger Jansen
> 
> 
> 
> -- 
> Slinger Remy Lokien Jansen
> 
> *email :* slinger at cs.uu.nl <mailto:slinger at cs.uu.nl>
> *office :* CGN-B228
> *telephone :* +31 (30) 253 6652
> *faxnumber :* +31 (30) 251 3791
> 
> *Universiteit Utrecht*
> Institute of Information and Computing Sciences
> Centrumgebouw Noord, office B228
> Padualaan 14, De Uithof
> 3584CH Utrecht
> 
> *scientific website : *http://www.cs.uu.nl/people/slinger/ 
> <http://www.cs.uu.nl/people/slinger>
> *personal website : *www.slingerjansen.nl <http://www.slingerjansen.nl>
> 
> 
> ------------------------------------------------------------------------
> 
> _______________________________________________
> 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