Search results
Tornado is a Python web framework and asynchronous networking library, originally developed at FriendFeed. By using non-blocking network I/O, Tornado can scale to tens of thousands of open connections, making it ideal for long polling, WebSockets, and other applications that require a long-lived connection to each user. Quick links¶
Tornado is a Python web framework and asynchronous networking library, originally developed at FriendFeed. By using non-blocking network I/O, Tornado can scale to tens of thousands of open connections, making it ideal for long polling, WebSockets, and other applications that require a long-lived connection to each user.
Web framework. tornado.web — RequestHandler and Application classes; tornado.template — Flexible output generation; tornado.routing — Basic routing implementation; tornado.escape — Escaping and string manipulation; tornado.locale — Internationalization support; tornado.websocket — Bidirectional communication to the browser; HTTP ...
Since Tornado supplies its own HTTPServer, running and deploying it is a little different from other Python web frameworks. Instead of configuring a WSGI container to find your application, you write a main() function that starts the server:
Structure of a Tornado web application¶ A Tornado web application generally consists of one or more RequestHandler subclasses, an Application object which routes incoming requests to handlers, and a main() function to start the server.
tornado.web provides a simple web framework with asynchronous features that allow it to scale to large numbers of open connections, making it ideal for long polling. Here is a simple “Hello, world” example app:
Structure of a Tornado web application; Templates and UI; Authentication and security; Running and deploying; Web framework; HTTP servers and clients; Asynchronous networking; Coroutines and concurrency; Integration with other services; Utilities; Frequently Asked Questions; Release notes
Tornado includes a simple, fast, and flexible templating language. This section describes that language as well as related issues such as internationalization. Tornado can also be used with any other Python template language, although there is no provision for integrating these systems into RequestHandler.render .
tornado.websocket — Bidirectional communication to the browser¶ Implementation of the WebSocket protocol. WebSockets allow for bidirectional communication between the browser and server.
This example does not use any of Tornado’s asynchronous features; for that see this simple chat room. Threads and WSGI¶ Tornado is different from most Python web frameworks. It