[Web-SIG] Defining a standard interface for common web tasks

Simon Willison cs1spw at bath.ac.uk
Fri Oct 17 15:02:21 EDT 2003


The following is part of an email I sent to Meta-SIG discussing possible 
targets for the Web-SIG.

An acknowledged problem with Python for web programming at the moment is 
the sheer abundance of web development frameworks currently available - 
newcomers to Python web programming literally have their work cut out 
just evaluating the options available to them.

mod_python (the framework with which I have had the most experience) 
provides an emulattion of the cgi module's FormFields interface as part 
of the mod_python package. Other frameworks may do this as well. I think 
this provides an interesting example of how the multiple framework 
problem could be partially resolved. If the Python standard library 
included a well defined interface for common web programming tasks (such 
as accessing data from forms and cookies, sending cookies and HTTP 
headers) existing web frameworks could be encouraged to either support 
this interface natively or provide some kind of wrapper from that 
interface to the internals of their framework. This would make selecting 
a web framework a far less dauntinfg process, as code written for one 
framework would be much easier to port to another.

An interesting example of this kind of process (albeit on a much larger 
scale) is Java's Servlet API specification. This defines the interfaces 
a Java servlet container must implement, but leaves the implementation 
details up to the team implementing the spec. This means commercial and 
open source vendors can create competing servlet engines, and developers 
have great flexibility in selecting a servlet container and switching to 
a different one should they run in to problems.

I'd like to see the Web SIG define a strong standard interface for 
common web tasks, which could then be supported by Python web framework 
authors.

Best regards,

Simon Willison
http://simon.incutio.com/





More information about the Web-SIG mailing list