Python web framework for asynchronous non-blocking IO--tornado

Source: Internet
Author: User
Tags nginx reverse proxy

The full name of Tornado is Torado Web server, which is known to be used as Web servers, but it is also a development framework for the Python web. It was originally used on the FriendFeed company's website and was open source after Facebook acquired it.

As a web framework, it is a lightweight web framework, similar to another Python web framework web.py, which has asynchronous non-blocking IO processing.

As a Web server, Tornado has an excellent load-resisting capability, and the official use of Nginx reverse proxy to deploy the tornado and other Python Web application framework for comparison, resulting in a maximum of more than the number of views of the second nearly 40%.

In addition, its source code is a great material for Python developers to learn and study.

The following is the Hello World sample program for tornado.

#-*-coding:utf-8-*-#!/usr/in/pythonImportTornado.ioloopImportTornado.webclassMainHandler (tornado.web.RequestHandler):defGet (self): Self.write ("Hello, World") Application=Tornado.web.Application ([(R"/", MainHandler),])if __name__=="__main__": Application.listen (8888) tornado.ioloop.IOLoop.instance (). Start ()

Before executing the program, install it on Ubuntu:

sudo Install tornado

 

Python web framework for asynchronous non-blocking IO--tornado

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.