Here is the canonical "Hello, world" example app:
- import tornado.httpserver
import tornado.ioloop
import tornado.web
])
if __name__ == "__main__":
- http_server = tornado.httpserver.HTTPServer(application)
- http_server.listen(8888)
+ application.listen(8888)
tornado.ioloop.IOLoop.instance().start()
See [Tornado walkthrough](#tornado-walkthrough) below for a detailed
<h2>Hello, world</h2>
<p>Here is the canonical "Hello, world" example app for Tornado:</p>
- <pre><code>import tornado.httpserver
-import tornado.ioloop
+ <pre><code>import tornado.ioloop
import tornado.web
class MainHandler(tornado.web.RequestHandler):
])
if __name__ == "__main__":
- http_server = tornado.httpserver.HTTPServer(application)
- http_server.listen(8888)
+ application.listen(8888)
tornado.ioloop.IOLoop.instance().start()</code></pre>
<p>See the <a href="/documentation">Tornado documentation</a> for a detailed walkthrough of the framework.</p>