README.rst 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. Tornado Web Server
  2. ==================
  3. .. image:: https://badges.gitter.im/Join%20Chat.svg
  4. :alt: Join the chat at https://gitter.im/tornadoweb/tornado
  5. :target: https://gitter.im/tornadoweb/tornado?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge
  6. `Tornado <http://www.tornadoweb.org>`_ is a Python web framework and
  7. asynchronous networking library, originally developed at `FriendFeed
  8. <http://friendfeed.com>`_. By using non-blocking network I/O, Tornado
  9. can scale to tens of thousands of open connections, making it ideal for
  10. `long polling <http://en.wikipedia.org/wiki/Push_technology#Long_Polling>`_,
  11. `WebSockets <http://en.wikipedia.org/wiki/WebSocket>`_, and other
  12. applications that require a long-lived connection to each user.
  13. Hello, world
  14. ------------
  15. Here is a simple "Hello, world" example web app for Tornado:
  16. .. code-block:: python
  17. import tornado.ioloop
  18. import tornado.web
  19. class MainHandler(tornado.web.RequestHandler):
  20. def get(self):
  21. self.write("Hello, world")
  22. def make_app():
  23. return tornado.web.Application([
  24. (r"/", MainHandler),
  25. ])
  26. if __name__ == "__main__":
  27. app = make_app()
  28. app.listen(8888)
  29. tornado.ioloop.IOLoop.current().start()
  30. This example does not use any of Tornado's asynchronous features; for
  31. that see this `simple chat room
  32. <https://github.com/tornadoweb/tornado/tree/stable/demos/chat>`_.
  33. Documentation
  34. -------------
  35. Documentation and links to additional resources are available at
  36. http://www.tornadoweb.org