Re: WSGI wrapper for Pyblosxom

Wari Wahab <[email protected]>
Newsgroups gmane.comp.web.pyblosxom.devel
Message-ID <[email protected]>
Bill Mill wrote:

>The problem was that my photo gallery called cgi.FieldStorage() in
>cb_start. I did not know that any subsequent calls to the
>FieldStorage() call would then return an empty dictionary as the cgi
>form.
>  
>
Oh yeah, think of FieldStorage() as reading the input (stdin) stream 
(which is the GET /and/ POST for the particular session), and because it 
is a stream, you won't get data anymore after reading that once due to 
the way HTTP works.

The problem with working with the assumtion of cgi only and porting 
stuff to other frameworks. If you use most other python web frameworks, 
you'll find that they already slurped the stdin leaving you with nothing 
when calling cgi.FieldStorage().

Most other frameworks do provide alternative access to the GET and POST 
variables, and some in a funky way. In pyblosxom's case, hopefully the 
http['form'] does provide everything people would need. Unfortunately, 
there's no way to override this (via a plugin for example) to use other 
frameworks' means of providing the GET and POST, at least not in the 
version I'm with.


-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now. 
http://productguide.itmanagersjournal.com/
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.