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

Ian Bicking ianb at colorstudy.com
Thu Oct 23 12:27:25 EDT 2003


On Thursday, October 23, 2003, at 07:38 AM, Steve Holden wrote:
> I'm not sure that we should be arguing to include something that 
> depends
> on a specific environment like Apache in the standard library. We 
> should
> certainly be trying to promote a standard of some sort, however, which
> seems to conflict.
>
> I see the parallel more as being with the DB API - there are Oracle
> modules and ODBC modules (which are cross-engine) and SQL Server 
> modules
> and so on. What we need is something to provide closely similar
> interfaces to different web server engines - whether those engines are
> in pure Python or external components.

This was my idea of what the request/response stdlib classes could 
accomplish -- if not a formal specification, at least a reference 
implementation which other people could use as a model.

> The one problem I see with mod_python is its defaulting behavior - you
> can get the same content several different ways. Specifically, the
> following URLs
>
> 	http://server/
> 	http://server/index.py
> 	http://server/index.py.index
>
> all refer to the same content, and this makes it rather difficult to
> come up with a scheme for producing sensible relative URLs -- the
> browsers don't always interpret the path the same way the server does 
> --
> which in turn can make it difficult to produce easily portable web
> content.

In general I would note that URL introspection is (as far as I've seen) 
poorly handled by nearly everyone.  In part because it's hard -- you 
can have multiple layers of things going on, with proxies, various 
virtual host configurations, aliases and location-specific handlers, 
mod_rewrite to mix everything up beyond hope, all before Python even 
becomes involved in the process.  Then there's a wide variety of ways 
the URL can continue to be mapped even after that.

Portably figuring out where an application exists, what its base is, 
and how it should best refer to other pages is difficult.  Then add 
things like non-cookie session IDs, :action GET variables, and other 
things that break out of the model.  It's challenging to make a good 
system to map URLs to resources, but people haven't really tried to 
meet the challenge of mapping resources back into URLs (and maybe it 
shouldn't even be attempted in a general way, but rather accomplished 
through some sort of configuration).

--
Ian Bicking | ianb at colorstudy.com | http://blog.ianbicking.org




More information about the Web-SIG mailing list