[mod_python] Help converting cgi to mod_python

Nick nick at dd.revealed.net
Thu Nov 18 09:46:44 EST 2004


Gustavo Córdova Avila wrote:
>
>    4. Some equivalencies:
>             environ["QUERY_STRING"]   --> request.args
>             environ["PATH_INFO"]   --> request.path_info
>             environ["HTTP_METHOD"] --> request.method
>             environ["CONTENT_LENGTH"] --> request.content_length
...
>   10. Instead of looking for environ["HTTP_<header-name>"], use 
> request.headers_in["header-name"]

You can actually get ALL The CGI variables in the req.subprocess_env dict 
after calling req.add_common_vars().  It's much easier to use this if all 
you're doing is converting CGIs.

Nick


More information about the Mod_python mailing list