[mod_python] How to stop reimporting modules

Jason Lanquist jason at ruff.com
Fri Apr 8 11:42:16 EDT 2005


Hi, I've got a page that refreshes itself every 45 seconds (fetching
dynamic content).  When it does this, the following line is added to the
apache error_log:

[notice] mod_python: (Re)importing module 'rt_track' with path set to
'['/home/hh4/public_htm
l']'

rt_track is not a py file, rather it's defined in index.py.  index.py
doesn't get updated very much at all anymore so I'm wondering why it has
to reimport each time?

Currently I have a couple of people beta testing this site but only
after a couple of hours, our error_log file is quite big with these
[notice] entries being added so frequently.  I dread to think of looking
at the log once more people start using it.  If this isn't a problem, is
there a way to get it to stop reimporting rt_track.  Is there a problem
with the way I am setup?

I'm running Linux Slackware 2.4.22 kernel
            Apache 2.0.49
            mod_python 3.1.3
            Python 2.3.3

mod_python setup in httpd.conf
---------------------
...
<Directory "/home/hh4/public_html/">
  AllowOverride All
  PythonInterpPerDirectory On
</Directory>
...
---------------------

/home/hh4/.htaccess
---------------------
SetHandler mod_python
PythonHandler mod_python.publisher
PythonDebug On
<Files ~ "\.(gif|jpe?g|png|class|js|wav|css)$">
  SetHandler default
</Files>
---------------------

I saw in the archives that turning PythonDebug Off will stop this but
since I am still in the debugging mode, PythonDebug is extremely helpful
to us so I would like to not have to turn that off.

Thanks,

Jason Lanquist


More information about the Mod_python mailing list