Skip to content


Subversion checkout URL

You can clone with
Download ZIP
Fetching contributors…
Cannot retrieve contributors at this time
66 lines (51 sloc) 4.93 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="">epoll</a>, 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>
<p>See the <a href="/documentation">Tornado documentation</a> for a detailed walkthrough of the framework.</p>
<h2>Download and install</h2>
<p><b>Download:</b> <a href="">tornado-1.1.tar.gz</a></p>
<pre><code>tar xvzf tornado-1.1.tar.gz
cd tornado-1.1
python build
sudo python install</code></pre>
<p>The Tornado source code is <a href="">hosted on GitHub</a>. On Python 2.6+, 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>Tornado has been tested on Python 2.5 and 2.6. To use all of the features of Tornado, you need to have <a href="">PycURL</a> and a JSON library like <a href="">simplejson</a> installed. Complete installation instructions for Mac OS X and Ubuntu are included below for convenience.</p>
<p style="font-weight:bold">Mac OS X 10.6 (Python 2.6)</p>
<pre><code>sudo easy_install setuptools pycurl</code></pre>
<p style="font-weight:bold">Mac OS X 10.5 (Python 2.5)</p>
<pre><code>sudo easy_install setuptools pycurl== simplejson</code></pre>
<p style="font-weight:bold">Ubuntu Linux (Python 2.6)</p>
<pre><code>sudo apt-get install python-pycurl</code></pre>
<p style="font-weight:bold">Ubuntu Linux (Python 2.5)</p>
<pre><code>sudo apt-get install python-dev python-pycurl python-simplejson</code></pre>
<h2>Hello, world</h2>
<p>Here is the canonical &quot;Hello, world&quot; example app for Tornado:</p>
<pre><code>import tornado.httpserver
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__":
http_server = tornado.httpserver.HTTPServer(application)
<p>See the <a href="/documentation">Tornado documentation</a> for a detailed walkthrough of the framework.</p>
<h2>Discussion and support</h2>
<p>You can discuss Tornado and report bugs on <a href="">the Tornado developer mailing list</a>.
<h2>Links and resources</h2>
<li><a href=""></a> - listing of sites using Tornado</li>
<li><a href="">T3</a> - Tornado ported to Python 3</li>
<li><a href="">Cyclone</a> - Tornado ported to the Twisted event loop</li>
<li><a href="">Tornado Tracing</a> - Performance tracing library for Tornado</li>
<p>Follow us on <a href="">Facebook</a>, <a href="">Twitter</a>, or <a href="">FriendFeed</a> to get updates and announcements:</p>
<div style="margin-top:1em"><a href="" style="margin-right:10px"><img src="/static/facebook.png" style="width:64px;height:64px" alt="Facebook"/></a><a href="" style="margin-right:10px"><img src="/static/twitter.png" style="width:64px;height:64px" alt="Twitter"/></a><a href="" style="margin-right:10px"><img src="/static/friendfeed.png" style="width:64px;height:64px" alt="Facebook"/></a></div>
{% end %}
Jump to Line
Something went wrong with that request. Please try again.