Tornado
User’s guide
Introduction
Asynchronous and non-Blocking I/O
Coroutines
Queue
example - a concurrent web spider
Structure of a Tornado web application
Templates and UI
Authentication and security
Running and deploying
Web framework
tornado.web
—
RequestHandler
and
Application
classes
tornado.template
— Flexible output generation
tornado.escape
— Escaping and string manipulation
tornado.locale
— Internationalization support
tornado.websocket
— Bidirectional communication to the browser
HTTP servers and clients
tornado.httpserver
— Non-blocking HTTP server
tornado.httpclient
— Asynchronous HTTP client
tornado.httputil
— Manipulate HTTP headers and URLs
tornado.http1connection
– HTTP/1.x client/server implementation
Asynchronous networking
tornado.ioloop
— Main event loop
tornado.iostream
— Convenient wrappers for non-blocking sockets
tornado.netutil
— Miscellaneous network utilities
tornado.tcpclient
—
IOStream
connection factory
tornado.tcpserver
— Basic
IOStream
-based TCP server
Coroutines and concurrency
tornado.gen
— Simplify asynchronous code
tornado.concurrent
— Work with threads and futures
tornado.locks
– Synchronization primitives
tornado.queues
– Queues for coroutines
tornado.process
— Utilities for multiple processes
Integration with other services
tornado.auth
— Third-party login with OpenID and OAuth
tornado.wsgi
— Interoperability with other Python frameworks and servers
tornado.platform.asyncio
— Bridge between
asyncio
and Tornado
tornado.platform.caresresolver
— Asynchronous DNS Resolver using C-Ares
tornado.platform.twisted
— Bridges between Twisted and Tornado
Utilities
tornado.autoreload
— Automatically detect code changes in development
tornado.log
— Logging support
tornado.options
— Command-line parsing
tornado.stack_context
— Exception handling across asynchronous callbacks
tornado.testing
— Unit testing support for asynchronous code
tornado.util
— General-purpose utilities
Frequently Asked Questions
Release notes
What’s new in Tornado 4.4.2
What’s new in Tornado 4.4.1
What’s new in Tornado 4.4
What’s new in Tornado 4.3
What’s new in Tornado 4.2.1
What’s new in Tornado 4.2
What’s new in Tornado 4.1
What’s new in Tornado 4.0.2
What’s new in Tornado 4.0.1
What’s new in Tornado 4.0
What’s new in Tornado 3.2.2
What’s new in Tornado 3.2.1
What’s new in Tornado 3.2
What’s new in Tornado 3.1.1
What’s new in Tornado 3.1
What’s new in Tornado 3.0.2
What’s new in Tornado 3.0.1
What’s new in Tornado 3.0
What’s new in Tornado 2.4.1
What’s new in Tornado 2.4
What’s new in Tornado 2.3
What’s new in Tornado 2.2.1
What’s new in Tornado 2.2
What’s new in Tornado 2.1.1
What’s new in Tornado 2.1
What’s new in Tornado 2.0
What’s new in Tornado 1.2.1
What’s new in Tornado 1.2
What’s new in Tornado 1.1.1
What’s new in Tornado 1.1
What’s new in Tornado 1.0.1
What’s new in Tornado 1.0
Tornado
Docs
»
User’s guide
View page source
User’s guide
¶
Introduction
Asynchronous and non-Blocking I/O
Blocking
Asynchronous
Examples
Coroutines
Python 3.5:
async
and
await
How it works
How to call a coroutine
Coroutine patterns
Interaction with callbacks
Calling blocking functions
Parallelism
Interleaving
Looping
Running in the background
Queue
example - a concurrent web spider
Structure of a Tornado web application
The
Application
object
Subclassing
RequestHandler
Handling request input
Overriding RequestHandler methods
Error Handling
Redirection
Asynchronous handlers
Templates and UI
Configuring templates
Template syntax
Internationalization
UI modules
Authentication and security
Cookies and secure cookies
User authentication
Third party authentication
Cross-site request forgery protection
Running and deploying
Processes and ports
Running behind a load balancer
Static files and aggressive file caching
Debug mode and automatic reloading
WSGI and Google App Engine