[mod_python] index.py

Terry MacDonald terry.macdonald at dsl.pipex.com
Wed May 12 16:31:25 EDT 2004

Hi all,

Here is my current apache config for mod_python:
PythonDebug on
PythonOption SessionDbm /tmp/app_sess.dbm
Alias /python/ "/var/www/python/"
<Directory "/var/www/python">
    PythonPath "['/var/www/python']+sys.path"
    AddHandler mod_python .py
    PythonHandler mod_python.publisher
    Options None
    AllowOverride None
    Order allow,deny
    Allow from all
Alias /app/ "/var/www/python/app/dev/"
                                                                                                                  <Directory "/var/www/python/app/dev">
    PythonPath ['/var/www/python/app/dev']+sys.path
    DirectoryIndex league.py
<Directory "/var/www/python/app/dev/members">
    PythonOption ApplicationPath /app/members
    PythonAuthenHandler authenticate
    AuthType Basic
    AuthName "Administration"
    Require valid-user

If my league.py file/module contains a function called index() and
another function called hello() then...

http://localhost/app/league.py successfully calls index()
http://localhost/app/ successfully calls index()
http://localhost/app/league.py/hello successfully calls hello()
http://localhost/app/hello causes a not found error on URL /app/hello

The last one contradicts what is described in section ' -
Traversal' of the mod_python manual.

Is this a bug, or is the apache config wrong?

Note: This is also the case if the league.py file is renamed to
index.py.  However, if I do that then http://app/ causes a forbidden

Registered Linux User # 311806

More information about the Mod_python mailing list