[Web-SIG] Useful ideas from PHP

Simon Willison cs1spw at bath.ac.uk
Fri Oct 17 14:59:51 EDT 2003

Ian Bicking wrote:
> This is really PHP vs. the Python cgi module.  Other Python web 
> frameworks do most of these things (some don't differentiate between GET 
> and POST variables, most use a different way of indicating files, and 
> there's some other features that are sometimes included in frameworks 
> and sometimes not, like access to the raw POST data or streaming output).
> So really this is a matter of getting Python's stdlib to include some of 
> the functionality that has been widely implemented elsewhere.  Or at 
> least, that's one possible goal.

This links in to the mail I sent to Meta-SIG a few days ago. I would 
like to see the CGI module (or its replacement in the standard library) 
define a solid interface for common web tasks and then lead by example, 
encouraging other web frameworks to implement that same interface (or 
provide a wrapper to it). This would make it far easier to move from one 
framework to another, which in turn would make the process of chosing a 
framework far less intimidating (if the chosen framework doesn't work 
out moving to another becomes an easier option).

I know of at least one precedent for this already: mod_python provides 
an interface to form variables that is modelled on cgi.FieldStorage(). 
Unfortunately, in my opinion FieldStorage isn't quite as capable as it 
needs to be (see my email comparing it to PHP).

Since PHP is almost certainly Python's biggest competitor in the web 
development arena, it makes sense to look hard at the things Python does 
well that Python's standard library (and associated software) doesn't.

Best regards,

Simon Willison

More information about the Web-SIG mailing list