[Twisted-Python] When can I start using web2?
mesozoic at polynode.com
Wed Oct 5 11:23:52 EDT 2005
In the VFS thread, Glyph wrote something very discussion-worthy here. I
want to point it out. In one act. No intermission. (Grab a snack.)
I run a website using Moshe's twisted-web, with code built on
twisted.web.woven, and I'm desperate to move. I'm rewriting all my site
code. But right now, web development with Twisted is stuck in limbo. I
don't want to go traipsing off with a Nevow application if there's no
migration path to web2. I don't want to start building with web2 if it's
not stable, or (worse) if it's simply not being developed because
everyone's attention is elsewhere. Where am I going with this? Read on.
glyph at divmod.com wrote:
> web2 should not be a trivial HTTP server with a small resource
> wrapper in it. It should be a full-featured web server. Web does
> not mean "http" - all web-related protocols, such as WebDAV, ftp,
> even SOAP or Gopher, should be part of the 'web server' product part
> of Twisted.
> Going forward, I will stipulate this requirement: each independent
> Twisted subpackage MUST be at least 2 things: a functioning
> infrastructure layer that can be used by 3rd party applications, and
> an application which can be used standalone or with application
> plugins. In twisted.web's case this application is a "web server",
> which primarily does HTTP but can provide other request/response
> based protocols as well. "application plugins" for the web server
> are things that respond to requests for particular URLs.
Glyph's first point is extremely valid: web2 needs to be a
fully-featured server. That means, in my mind, everything that
twisted.web does, then something more. It might be that web2 supports
all of that already, but if so, that support isn't documented very well,
and one very striking reality of today's world is that if your web
framework isn't well-documented, people won't have the patience for it.
A list of things I haven't seen out of web2 yet:
* Painless web server deployment.
Moshe's twisted-web package was a functional, useful package that
allowed sysadmins to set up servers that used twisted.web in a very easy
way. It had things like /etc/twisted-web/local.d, where you could throw
your own deployment scripts, which I've found very useful. It also made
it *dead simple* for someone with just basic knowledge to set up a
working server, even if just for serving static pages. I think that
having something like this included in twisted.web2 would be a great
place to start; wubwubwub is probably the best place to work from.
* File uploads.
This was a major sticking point with twisted.web. In fact, it was the
most commonly-repeated problem I heard, and a problem I know someone,
somewhere, has to have solved by now on their own. So how does this work
in twisted.web2? More importantly, how can it be added to a twisted.web
application that is being migrated? Can it be added piecemeal?
web2/fileupload.py is a bit intimidating; someone needs to lead us
straight to the hidden treasure.
* Clear migration path from an existing twisted.web application.
If I've written an application that has old-style resources, do I even
have an upgrade path? What about twisted.web.distrib? A lot of people
use this, especially with sockets; what's the web2 equivalent?
* Clear migration path from an existing Nevow application.
If I have a Nevow site, a set of resources, and an application that
revolves around them, and I want to start using web2, where do I start?
* Comparison of major design changes.
This ties in with the migration path from Nevow. What the heck does the
streams module do? What's different about the appserver, context,
requests, static files, or virtual hosts?
All of these are things that either do not exist, or do not have
adequate documentation. If twisted.web2 is indeed reliable enough for
people to start building things like WebDAV and Paste scripts on top of
it, then it needs to be cut-and-dry how to do all these things that
we've come to expect from Twisted's next web framework.
"Never let your sense of morals prevent you from doing what is right."
-- Salvor Hardin, Isaac Asimov's _Foundation_
More information about the Twisted-Python