[Twisted-Python] To twisted.web beginners: don't use RPYs

Itamar Shtull-Trauring itamar at itamarst.org
Mon Jun 23 16:33:51 EDT 2003

On 23 Jun 2003 14:20:02 -0500
Bill Gribble <grib at billgribble.com> wrote:

> You guys need to get your story straight.  radix and moshez both told
> me unequivocally on IRC that as a twisted.web beginner I should
> *definitely* be using RPYs, in fact that all twisted.web development
> should be done using RPY until the app was ready to be packaged and
> deployed. 

This works great if you understand twisted.web well and know that web
applications aren't *pages*. Once you understand that you will typically
develop using a single RPY for your whole application, which has some
nice benefits for debugging.

If you think you should have multiple RPYs plonked in folders as a way
of developing your application, you are most likely doing something
wrong and should avoid using RPYs altogether.

As is usually the case, if you *do* know what you're doing it may be the
right thing, so an expert twisted user may recommend doing something
else depending on what your application is.

> >   site = server.Site(Simple())
> >   reactor.listenTCP(8080, site)
> >   reactor.run()
> ... and moshez barfed up a kidney when I said I was doing listenTCP
> manually, saying that listenTCP was about to be deprecated with
> extreme prejudice and should be avoided.  No real reason given other
> than "it's a bad idea". 

app.listenTCP is going to be deprecated, not reactor.listenTCP. And yes,
app.listenTCP is a bad idea.

Itamar Shtull-Trauring    http://itamarst.org/
http://www.zoteca.com -- Python & Twisted consulting

More information about the Twisted-Python mailing list