Tornado is a Python web framework and asynchronous networking library, originally developed at FriendFeed. http://www.tornadoweb.org/
  • Python 99.6%
  • Shell 0.2%
  • C 0.2%
Find a file
Ben Darnell ff863f38b0
Merge pull request #3960 from bdarnell/license-classifier
setup: Remove deprecated license classifier
2026-12-02 17:18:02 -05:00
.github ci: Pin setup-uv to a full version so Dependabot can update it 2026-12-02 21:51:17 +00:00
demos demos: Catch backslash and whitespace variants in "next" redirect checks 2026-11-02 15:46:17 +00:00
docs Merge pull request #3957 from bdarnell/claude/project-thread-oanb9o 2026-12-02 15:34:33 -05:00
maint maint: Don't report a broken pipe as a crash in fuzz_http_server 2026-11-20 14:18:45 +00:00
tornado Merge pull request #3957 from bdarnell/claude/project-thread-oanb9o 2026-12-02 15:34:33 -05:00
.coveragerc ci: Drop CaresResolver from the coverage run 2026-10-15 01:36:27 +00:00
.flake8 *: Update black 2024-06-04 14:19:52 -04:00
.gitattributes test: Add gitattributes for test data files 2020-01-18 14:18:50 -05:00
.gitignore maint: Add atheris fuzzers for HTTP parsing 2026-11-09 23:03:38 +00:00
.readthedocs.yaml docs: Sync readthedocs python version with tox.ini 2024-06-12 09:57:44 -04:00
codecov.yml Disable intrusive codecov features 2016-05-21 18:51:33 -04:00
CONTRIBUTING.md CONTRIBUTING.md: Introduce new "how to help" section 2026-11-24 21:03:22 -05:00
LICENSE Add top level LICENSE file 2013-08-22 19:28:35 -04:00
MANIFEST.in test: Add a snapshot test of the public API 2026-10-15 18:15:51 +00:00
pyproject.toml build: Don't select the development Python version in cibuildwheel 2026-12-02 19:24:25 +00:00
README.rst Improve and update the tornado branding and readme header #3609 2026-04-15 18:12:37 +01:00
requirements.in test: Add property-based tests for HTTP parsing and encoding 2026-10-15 14:04:07 +00:00
requirements.txt Merge pull request #3847 from tornadoweb/dependabot/pip/black-26.10.1 2026-10-26 12:20:47 -04:00
runtests.sh Remove some vestigial references to 2to3. 2014-01-19 18:55:53 -05:00
SECURITY.md SECURITY.md: Add an email address 2026-11-16 09:47:14 -05:00
setup.cfg Type-check Tornado with mypy --strict 2026-10-16 14:04:47 +00:00
setup.py setup: Remove deprecated license classifier 2026-12-02 15:43:14 -05:00
tox.ini asyncio: Handle removed event loop policy in Python 3.16 2026-11-19 21:35:04 -05:00

.. image:: docs/tornado.png?raw=true
   :alt: Tornado Web
   :align: center

Tornado Web Server
==================

`Tornado <http://www.tornadoweb.org>`_ is a Python web framework and
asynchronous networking library, originally developed at `FriendFeed
<http://friendfeed.com>`_.  By using non-blocking network I/O, Tornado
can scale to tens of thousands of open connections, making it ideal for
`long polling <http://en.wikipedia.org/wiki/Push_technology#Long_Polling>`_,
`WebSockets <http://en.wikipedia.org/wiki/WebSocket>`_, and other
applications that require a long-lived connection to each user.

Hello, world
------------

Here is a simple "Hello, world" example web app for Tornado:

.. code-block:: python

    import asyncio
    import tornado

    class MainHandler(tornado.web.RequestHandler):
        def get(self):
            self.write("Hello, world")

    def make_app():
        return tornado.web.Application([
            (r"/", MainHandler),
        ])

    async def main():
        app = make_app()
        app.listen(8888)
        await asyncio.Event().wait()

    if __name__ == "__main__":
        asyncio.run(main())

This example does not use any of Tornado's asynchronous features; for
that see this `simple chat room
<https://github.com/tornadoweb/tornado/tree/stable/demos/chat>`_.

Documentation
-------------

Documentation and links to additional resources are available at
https://www.tornadoweb.org