[mod_python] servlet (mps_tutorial) and apache

Daniel Popowich dpopowich at comcast.net
Sun Jul 11 21:44:38 EDT 2004

> In your example of mps_tutorial, all _files.py ('.py') are compiled and
> i think by default when you run for the first time.
> But imagine you exemple with some diffs.:
>    1- tutorial instaled and configured in:  /var/www/mps_tutorial/
>    2- all your _*.py are in: /var/www/mps_tutorial/pyfiles/
>    3- all your *.mps are in: /var/www/mps_tutorial/
>    4- you have a __init__.py in /var/www/mps_tutorial/ with __vars__ =
> ["pyfiles"]
>    5- you have a __init__.py in /var/www/mps_tutorial/pyfiles with
> __vars__ = ["_SitePage", "_TutorialBase", "_HTML", "_HTMLHighlightedPy"]

I have never heard of __vars__.  Do you mean __all__?  Regardless,
this should have no impact on the generation of pyc files.

> In your index.mps you have something like:
> from pyfiles._TutorialBase import *
> It works fine but dont creat any .pyc of *.py... why not?

When python imports a module and the pyc file does not exist it tries
to create it, and will, if the process has write permissions to the
directory containing the py file.

Does the directory you've created, pyfiles, allow write permissions to
the httpd process uid?


More information about the Mod_python mailing list