Tornado is a scalable web server and web framework for Python specializing in handling thousands of simultaneous connections and real-time services.

Tornado

A web server and a web framework for Python. Originally built to power FriendFeed (owned by Facebook), it is now an open source project and used by sites like Quora and Hipmunk. Tornado uses non-blocking IO and asynchronous programming patterns to attain greater scalability and speed. While documentation is somewhat light, there is an active mailing list and a supportive community. The framework is also designed to be simple, along the lines of web.py or bottle, without some of the more complex setup of web frameworks like Django.

The current version is 5.0.2

Hello, world

Here is a simple “Hello, world” example web app for Tornado:

import tornado.ioloop
import tornado.web

class MainHandler(tornado.web.RequestHandler):
    def get(self):
        self.write("Hello, world")

application = tornado.web.Application([
    (r"/", MainHandler),
])    

if __name__ == "__main__":
    application.listen(8888)
    tornado.ioloop.IOLoop.instance().start()

This example does not use any of Tornado’s asynchronous features; for that see this simple chat room.