[mod_python] URL redirect

Kory Hamzeh kory at avatar.com
Mon Aug 1 23:22:14 EDT 2011


> Maybe you could try to set status :
>    req.headers_out["Location"] = "http://www.example.com"
>    req.status = apache.HTTP_MOVED_TEMPORARILY
> 

Thank you for the reply -- that works perfectly. I do have another
questions.

I'm trying to understand how form data/values are passed to the handler when
the client does a POST. The docs seem to say conflicting thing. This page:

	
http://www.modpython.org/live/current/doc-html/hand-pub-alg-args.html

says the form data is passed as arguments to the handler. This seems to work
and every example code I've seen uses this method. But this page:

	http://www.modpython.org/live/current/doc-html/node103.html

states that form data/values are passed in as an instance for the
FieldStorage class in a variable called 'form' in the request object. I have
never seen an instance of this object or any variable named 'form' in the
request structure. What am I misunderstanding?

The first method (values passed as arguments to the handler) works for
simple/small forms, but one of my pages contains a large variable length
form with many fields. Being able to fetch the values using the FieldStorage
class which be much more practical.

Any help would be greatly appreciated!

Thanks,
Kory




More information about the Mod_python mailing list