[mod_python] using handler, no req.form

Graham Dumpleton graham.dumpleton at gmail.com
Fri Jun 15 02:03:08 EDT 2007


On 15/06/07, David Bear <David.Bear at asu.edu> wrote:
> I'm using python handler. I wrote a simple function to return items in
> posted form sent to the handler. However, modpython tells me there is
> no req.form... well, more precisely:
>
> mp_request object has no attribute form.
>
> I thought a form object would be created by apache when a post method
> was used. Is a req.form object only created when using publisher?

Correct.

> I am
> looking and some code I wrote a year ago that worked.. but I left it
> for other project.
>
> When using handler, where does the post data get put?

Not put anywhere, still there waiting to be read in:

  from mod_python import util

  def handler(req):
    req.form = util.FieldStorage(req, keep_blank_values=1)
    ...

Graham


More information about the Mod_python mailing list