When we learn Python When , You can't avoid dealing with frameworks , I've introduced Django frame 、Flask frame , So the editor of this article wants to introduce Tornado,Python Web The mainstream framework of programming .
Tornado It's using Python Write a powerful extensible Web The server , It's robust enough to handle high network traffic , It's lightweight enough to create and write , And can be used in a large number of applications and tools .Tornado As FriendFeed The basic framework of the website , Published on 2009 year , Get a lot of community support , And it has been applied in a series of different occasions .
contrast Python Other network frameworks ,Tornado It has the following characteristics ：
complete Web frame , And Django、Flask equally ,Tornado Also provided URL Route mapping 、Request Context 、 Template based page rendering technology and other necessary tools .
Tornado Is an efficient network library , Performance and Twisted、Gevent Wait for the bottom Python The frame is as good as , Provides asynchronous IO Support 、 Timeout event handling , bring Tornado In addition to being able to Web Application server framework , It can be used as a crawler application 、 IOT gateway 、 Game server and other background applications .
Provide efficient HTTPClient, In addition to the server-side framework ,Tornado It also provides an asynchronous framework based HTTP client .
Tornado It also provides efficient internal management HTTP The server , Although others Python Network framework Django、Flask It also provides the interior HTTP The server , But their HTTP The server can only be used in the test environment for performance reasons , and Tornado Of HTTP The server and Tornado Asynchronous calls are tightly combined , It can be used directly in the production environment .