I agree, Twisted is not a web application framework. So the question is this: do we want/need a web application framework for Onionoo? It seems like it is such a straightforward service (process one of a very few different request types, send back a JSON response) that maybe any web application framework is overkill.
According to Sathya, Cyclone does have some functionality for converting dicts to JSON (of course, so does the json standard library module) and sets response headers properly automatically. So that also makes some of the coding easier and possibly more maintainable. The latter is definitely not to be sneezed at; I just don't have enough experience with either Twisted or Cyclone to know whether it makes up for the additional dependency.
- Norman
On 7/10/12 3:04 PM, meejah@meejah.ca wrote:
Norman Danner ndanner@wesleyan.edu writes:
Based on a quick look, it seems like Cyclone provides a slightly nicer way to specify how to handle the various requests than does a plain Twisted web application. Are there any other advantages to using Cyclone as opposed to plain Twisted?
From what I understand of the two systems, Twisted's "web stuff" isn't really intended as a "web application framework" (yet?) and you'd probably want Nevow or Twisted.web2 for that anyway. Cyclone and Tornado, OTOH, *are* Web frameworks. The advantage of Cyclone being that it's based on the core Twisted async "stuff" rather than Tornado's homebrew (and hence supports more things, has tests, cross-platform support, etcetera).
Using Cyclone would also allow you to use txtorcon, as it's based on Twisted too :)