20 Raspberry Pi build SERVER

https://zhuanlan.zhihu.com/p/51704645

To simplify the development of Web applications, so that developers can concentrate on writing business logic code without concern for repetitive working of each module is connected within a Web application class in turn generates a Web application on the Web frame. General Web Framework architecture shown below, Django, tornado, flask, webpy different so adjusted within this range, such as Web-based framework Python.

 

I believe we should be the initial impression of large and Django, Flask small but high-performance Tornado.

In the Python web development framework, currently has the highest amount of Django, Flask and Tornado, often someone will take several comparison, I believe we should be the initial impression of large and Django, Flask small but high-performance Tornado.
Python Django is the most versatile web development framework, large and take direction. It is best known for its fully automated management background: Since only need to use ORM, do simple object definitions, it can automatically generate the database structure, as well as full-featured management background. However, Django provides convenient, but also means Django ORM built with a high degree of coupling other modules, the depth of the bound framework, the application must use the built-in Django ORM, or can not enjoy the offer within the framework of various Based within the framework of outstanding characteristics of its ORM.
Tornado full name Tornado Web Server, it is written in Python Web server and Web application framework. Tornado is taking the direction of fewer but better, focusing on superior performance, it is best known for asynchronous non-blocking server approach. (Tornado framework composition and a server with a full stack WSGI of alternatives. Tornado used alone or tornaod http web server framework WSGI container, there are some limitations, to maximize the use of the performance of the tornado, recommended use a web tornaod framework and HTTP server.)
the Flask written in Python is a lightweight Web application framework, also known as "microframework", a simple syntax, easy to deploy, the entire framework comes with a path mapping, template engine (Jinja2), simple database access and other web frameworks component that supports WSGI protocol (using Werkzeug). Flask use BSD license. Flask using a simple core, increase other functions extension, though no database used by default, form validation tool, however Flask retained the amplification of flexibility can be added ORM with Flask-extension, form validation tools, file upload, each kind of open authentication technology functions.
From a performance point of view, compared with Tornado than Django, Flask and other mainstream Web server framework obvious difference: it is non-blocking server, very fast. However Tornado compared to Django and Flask framework belong to the more primitive, less plug-ins, many content needs its own to deal with. The Flask plugins and more documentation is very professional, a dedicated team of maintenance company, for the rapid development of very efficient. Because of WSGI protocol, the server may be combined with the asynchronous nature of Tornado, and concurrent processing capability and scalability Flask document as a whole. Although simple WSGI servers like Django, Flask framework has its own implementation, but generally used for debugging server with other WSGI server, such as Nginx + uwsgi + Django Recommended production environment.

Guess you like

Origin www.cnblogs.com/kekeoutlook/p/11267408.html