[Twisted-web] some questions about twisted.web

Jack Moffitt jack at chesspark.com
Tue Apr 7 14:57:50 EDT 2009

>> Now I've just deluged the poor user with lots of factory start and
>> stops.  All I want is normal HTTP style logs.  Twisted's logging
>> infrastructure has its place, but it is not quite ready to produce
>> user friendly output for a simple utility.
> That's probably a bug/feature request.

I think such bugs exist, but in case they don't, I'll file it.  There
just needs to be some control on what I want to see without having to
subclass every bit of twisted to turn it off.  For the most part I've
not cared so much because we generate so much of our own logging in
the daemons we build that the extra noise is negligible  For end user
logs though, anything more than the bare minimum is quickly
overwhelming.  ejabberd (and many other Erlang apps) have this same

>> Great, now the user has to edit a tac file just to configure the
>> thing.  I'd rather them be able to type "tape" and not have to worry
>> about twistd -ny some.tac.  I use tac files a lot, but they don't make
>> much sense for simple utilities.  It sucks that it's either/or with
>> Twisted applications.
> I'm assuming "tape" is your application?

Yes.  And by application, it's 150 lines in one file.  Command line
user oriented XMPP tools are another area where I hit this problem a
lot.  I essentially am reduced to bootstrapping all the infrastructure
myself when twistd doesn't fit the problem.  It makes simple examples
very difficult to construct or blog about.  All that dumb code gets in
the way.  Writing Twisted daemons is beautiful, and clients should be

> Basically, you're right - the resource dispatch in t.web is, to say the
> least, difficult. Sadly, you need to change both the http server, channel
> and request code to alter it (which is what Nevow does)
[and later...]
> I believe the eventual plan is to have t.web use the nevow appserver &
> resource model, with backwards compatibility stubs.

So we have Woven, Nevow, web, and web2.  It's a giant mess.  It's
unclear to users which thing is the current thing, although there has
been quite a bit of everyone pointing to twisted.web lately.  They all
have their own problems, and it's not clear to me that backwards
compatibility is a great thing here.   The problem space is well
understood now, or at least better understood than several years back,
and most of these were designed beforehand.   Let legacy users add
"from twisted.legacy import web" and let's make something actually
useful in its place.

What I love about twisted.web is that for the most part, it's
extremely simple and easy to work with.  I should note that it's
awesome that I was able to write a small proxying web server in so few
lines.  It's just slightly frustrating that it is plagued by all these
little issues.


More information about the Twisted-web mailing list