Newbie Question on re-direct in Python

Gerhard Häring gerhard.haering at gmx.de
Fri Oct 11 23:16:30 EDT 2002


Daniel Lupton wrote in comp.lang.python:
> I am trying to get one of my python cgi scripts to load another script to
> the browser when a test fails but I have not idea how to. [...]

You'll probably want to send a HTTP Redirect response that directs the
browser to the new page. Here's a recipe:

http://www.faqts.com/knowledge_base/view.phtml/aid/2741/fid/245

According to http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html
303 might be a better status code than 302, which is used in the FAQTS
recipe.

-- Gerhard



More information about the Python-list mailing list