Mod_publisher and forms

[email protected] Tue, 13 Jul 2010 10:46:21 +0200 (CEST)
Newsgroups gmane.comp.python.mod_python
Message-ID <[email protected]>
Hello,

I use mod python and publisher. But when a lot of things doesn't work :

To test , i use this code for the file mptest.py:

def index(req, an_arg='default'):
    req.content_type = 'text/html'
    return some_html

when I look at localhost/test/mptest.py ,I see :

File "C:\Python25\Lib\site-packages\mod_python\importer.py", line 1537, in
HandlerDispatch
    default=default_handler, arg=req, silent=hlist.silent)

  File "C:\Python25\Lib\site-packages\mod_python\importer.py", line 1229,
in _process_target
    result = _execute_target(config, req, object, arg)

  File "C:\Python25\Lib\site-packages\mod_python\importer.py", line 1128,
in _execute_target
    result = object(arg)

  File "C:\Python25\Lib\site-packages\mod_python\publisher.py", line 213,
in handler
    published = publish_object(req, object)

  File "C:\Python25\Lib\site-packages\mod_python\publisher.py", line 425,
in publish_object
    return publish_object(req,util.apply_fs_data(object, req.form, req=req))

  File "C:\Python25\Lib\site-packages\mod_python\util.py", line 554, in
apply_fs_data
    return object(**args)

  File "C:\Program Files\OCS Inventory NG\xampp\htdocs\test\mptest.py",
line 3, in index
    return some_html

NameError: global name 'some_html' is not defined


So I can generate html code if I don't use " req.write"...
I think I have a problem with  module mod_python.publisher... It don't
allow to generate forms request.

Here my apache configuration :
<IfModule python_module>
AddHandler mod_python .py
PythonHandler mod_python.publisher
PythonDebug On
</IfModule>

If you have any idea to solve my problem, THANKS TO  tell me.