mod_python bytecompiling

grahamd at grahamd at
Wed Mar 29 12:11:10 CEST 2006

Fredrik Lundh wrote:
> "mneagul" wrote:
> >    I am writing a small program using mod_python publisher extension. I
> > have created several python files and imported them in a `main' file.
> >    How can I stop mod_python to byte compile the files? I want to make
> > changes to the files and see result imediately!
> >
> >    In the current setup only the changes to the `main' file are applied
> > imediately. I is nearly imposible to develop an application this way.
> >
> >    I want to mention that I'm a newby to mod_python.
> the FAQ has the answer:
>     "Q. My module imports other modules - how do I reload those?"
> (another approach, used by several frameworks, is to use a stand-alone
> test server for development, and mod_python for deployment)

Simply using apache.import_module() is not going to necessarily help
at the moment as it has various problems and shortcomings. One of
them is that it does not check multiple levels of dependencies between
modules. Thus simply replacing global imports in a module with a call
to apache.import_module() will not help.

For a full list of problems and issues with the mod_python module
importer see:

There is a new module importer being tested with mod_python 3.3
which will hopefully eliminate the major problems.

Highly recommend that original poster get onto the mod_python mailing
list to discuss what he can do in the interim.


More information about the Python-list mailing list