Reputation: 473
I use mod_python.publisher to run Python code and discovered a problem: When I update a script the update doesn't always work right away and I get the same error I fixed with the update until I restart Apache.
Sometimes it works right away, but sometimes not...but restarting Apache definitely always catches it up. It's a pain to have to restart Apache so much and I would think there is a better way to do this -- but what is it?
Upvotes: 0
Views: 1111
Reputation: 473
This is the expected behavior of mod_python. Your code is loaded into memory and won't be refreshed until the server is restarted.
You have two options:
Set MaxRequestsPerChild 1 in your httpd.conf file to force Apache to reload everything for each request.
Set PythonAutoReload to be On
http://www.modpython.org/live/mod_python-3.2.5b/doc-html/dir-other-par.html
But don't do that on a production server, as it will slow down the initialization time.
Upvotes: 3