Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

69 lines (52 sloc) 5.162 kb
{% extends "base.html" %}
{% block body %}
<p><a href="">Tornado</a> is an open source version of the scalable, non-blocking web server and tools that power <a href="">FriendFeed</a>. The FriendFeed application is written using a web framework that looks a bit like <a href=""></a> or <a href="">Google's webapp</a>, but with additional tools and optimizations to take advantage of the underlying non-blocking infrastructure.</p>
<p>The framework is distinct from most mainstream web server frameworks (and certainly most Python frameworks) because it is non-blocking and reasonably fast. Because it is non-blocking and uses <a href=""><code>epoll</code></a> or <code>kqueue</code>, it can handle thousands of simultaneous standing connections, which means it is ideal for real-time web services. We built the web server specifically to handle FriendFeed's real-time features &mdash; every active user of FriendFeed maintains an open connection to the FriendFeed servers. (For more information on scaling servers to support thousands of clients, see The <a href="">C10K problem</a>.)</p>
<h2>Upgrading from Tornado 1.x</h2>
<p>Tornado 2.0 introduces several potentially backwards-incompatible changes,
including in particular automatic escaping of template output. Users
who are upgrading from Tornado 1.x should see the
<a href="/documentation/releases/v2.0.0.html">release notes</a> for
information about backwards compatibility.</p>
<h2>Quick links</h2>
<li><a href="/documentation/index.html">Documentation</a></li>
<li><a href="{{version}}.tar.gz">Download version {{version}}</a> (<a href="/documentation/releases.html">release notes</a>)</li>
<li><a href="">Source (github)</a></li>
<li><a href="">Mailing list</a></li>
<li><a href="">Wiki</a></li>
<h2>Hello, world</h2>
<p>Here is the canonical &quot;Hello, world&quot; example app for Tornado:</p>
<pre><code>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__":
<p>See the <a href="/documentation/index.html">Tornado documentation</a> for a detailed walkthrough of the framework.</p>
<p><b>Automatic installation:</b> Tornado is listed in <a href="">PyPI</a> and can be installed with <code>pip</code> or <code>easy_install</code>. Note that the source distribution includes demo applications that are not present when Tornado is installed in this way, so you may wish to download a copy of the source tarball as well.</p>
<p><b>Manual installation:</b> Download <a href="{{version}}.tar.gz">tornado-{{version}}.tar.gz</a></p>
<pre><code>tar xvzf tornado-{{version}}.tar.gz
cd tornado-{{version}}
python build
sudo python install</code></pre>
<p>The Tornado source code is <a href="">hosted on GitHub</a>. On Python 2.6 and 2.7, it is also possible to simply add the tornado directory to your <code>PYTHONPATH</code> instead of building with <code></code>, since the standard library includes <code>epoll</code> support.</p>
<p><b>Prerequisites:</b> Tornado runs on Python 2.5, 2.6, 2.7 and 3.2.
<li>On Python 2.6 and 2.7, there are no dependencies outside the Python standard library, although <a href="">PycURL</a> (version 7.18.2 or higher required; version 7.21.1 or higher recommended) may be used if desired.</li>
<li>On Python 2.5, PycURL is required, along with <a href="">simplejson</a> and the Python development headers (typically obtained by installing a package named something like <code>python-dev</code> from your operating system).</li>
<li>On Python 3.2, the <a href="">distribute</a> package is required. Note that Python 3 support is relatively new and may have bugs.</li>
<p><b>Platforms:</b> Tornado should run on any Unix-like platform, although
for the best performance and scalability only Linux and BSD (including
BSD derivatives like Mac OS X) are recommended.</p>
<h2>Discussion and support</h2>
<p>You can discuss Tornado and report bugs on <a href="">the Tornado developer mailing list</a>. Links to additional resources can be found on the <a href="">Tornado wiki</a>.
{% end %}
Jump to Line
Something went wrong with that request. Please try again.