このハンドラを使うには、設定ファイルに以下のような行を追加します:
<Directory /some/path>
SetHandler mod_python
PythonHandler mod_python.publisher
</Directory>
このハンドラを使うと、モジュール内の関数や変数を URL でアクセスできるように なります。例えば、hello.py という名の以下のようなモジュールが あるとしましょう:
""" Publisher example """ def say(req, what="NOTHING"): return "I am saying %s" % what
http://www.mysite.com/hello.py/say という URL は
"I am saying NOTHING" を返します。一方
http://www.mysite.com/hello.py/say?what=hello は
"I am saying hello" を返します。