Python Web Development Libraries 简明教程

Python Frameworks

Python 是一种网络和应用程序开发者最可接受的语言之一,因为它注重效率和可读性。有许多杰出的 Python Web 框架,每个框架都有自己的专长和功能。

Python is one of the most acceptable languages among web and application developers because of its strong emphasis on efficiency and readability. There are numerous outstanding Python web frameworks, each with their own specialities and features.

Django

在这里,我们将概述 Django 框架的一些必要的详细信息和功能。

Here, we will outline some necessary details and features of Django framework.

Category - Django 属于全栈 Python 框架。

Category − Django belongs to the full-stack Python framework.

Release - 最新版本 – 2.1 版本,常用版本 – 1.8、1.6 版本。

Release − Latest release – 2.1 version, commonly used release – 1.8, 1.6 version.

About - Django 是由经验丰富的开发者构建的高级 Python Web 框架,它允许进行快速、干净和实用设计开发。Django 处理了网络开发的许多复杂性,因此你可以专注于编写应用,而无需发明轮子。Django 是免费且开源的。

About − Built by experienced developers, Django is a high level Python web framework which allows rapid, clean and pragmatic design development. Django handles much of the complexities of web development, so you can focus on writing your app without a need to reinvent the wheel. It’s free and open source.

为了将对象映射到数据库表,Django 使用 ORM,并且同样的方法用于在数据库之间转移数据。

To map objects to database table, Django uses ORM and the same is used to transfer from one database to other.

它与大多数所有重要数据库(如 Oracle、MySQL、PostgreSQL、SQLite 等)配合使用。

It works with mostly all important databases like Oracle, MySQL, PostgreSQL, SQLite, etc.

业界中有众多网站使用 Django 作为其后端开发的主要框架。

There are numerous websites in the industry which uses Django as their primary framework for backend development.

Features of Django

此 Python Web 框架的一些优秀特性是 −

Some of the exemplary features of this Python web framework are −

  1. URL routing

  2. Authentication

  3. Database schema migrations

  4. ORM (Object-relational mapper)

  5. Template engine

Django 框架的官方网站是 − https://www.djangoproject.com/

The Official Website for Django framework is −https://www.djangoproject.com/

django

Flask

Category − Flask 属于非全栈框架。

Category − Flask belongs to Non Full-stack frameworks.

Release − 1.0.2 于 2018 年 5 月 2 日发布

Release − 1.0.2 released on 2018-05-02

About − 我们将其归类为微型框架,因为我们不需要任何特定的库或工具。它没有表单验证或数据库抽象层,或任何预先存在的第三方库提供通用函数的其他组件。但是,flask 支持多个扩展,这些扩展扩展了应用程序功能,就好像它们是在 Flask 本身中实现的一样。存在用于对象关系映射、表单验证、上传处理、各种开放身份验证技术和几个常见框架相关工具的扩展。

About − It is classified as a micro-framework as we don’t require any particular libraries or tools. It has no form validation or database abstraction layer or any other components where pre-existing third party libraries provide common functions. However, flask support multiple extensions which extended the application features as if they were implemented in Flask itself. Extensions exist for object-relational mappers, form validation, upload handling, various open authentication technologies and several common frameworks related tools.

Features of Flask

  1. Integrated support for unit testing

  2. Restful request dispatching

  3. Contains development server and debugger

  4. Uses Jinja2 templating

  5. Support for secure cookies

  6. Unicode-based

  7. 100% WSGI 1.0 compliant

  8. Extensive documentation

  9. Google App Engine compatibility

  10. Extensions available to enhance features desired

flask

Web2py

Category − Web2py 属于全栈框架系列。

Category − Web2py belongs to Full-stack framework family.

Release − 2.17.1,已于 2018 年 8 月 6 日发布

Release − 2.17.1, released on 2018-08-06

About − Python 2.6、2.7 至 Python 3.x 版本。无进一步依赖,它本身就是一个完整软件包。应用程序的开发、数据库管理、调试、部署、测试和维护都可以通过 Web 界面来完成,但通常不需要。这是一种可扩展的开源框架,配有它自己的基于 Web 的 IDE,以及代码编辑器、一键式部署和调试器。

About − Python 2.6, 2.7 to Python 3.x version. With no further dependencies, it’s a complete package in itself. Development, database administration, debugging, deployment, testing, and maintenance of applications all can be done through web interface, but generally not required. It is a scalable open source framework that comes with its own web-based IDE alongside a code editor, one-click deployment and debugger.

Features of Web2py

此框架附带了许多开发工具和内置功能,消除了开发者的复杂化繁琐过程。

This framework comes with many developing tools and built-in features that eliminate the hassle of complexity to the developers.

  1. With no installation and configuration, it is easy to run.

  2. Supports almost all major operating system, like Windows, Unix/Linux, Mac, Google App Engine and almost all web hosting platform through Python 2.7/3.5/3.6/ version.

  3. Easy to communicate with MySQL, MSSQL, IBM DB2, Informix, Ingres, MongoDB, SQLite, PostgreSQL, Sybase, Oracle and Google App Engine.

  4. It prevents the most common types of vulnerabilities including Cross Site Scripting, Injection Flaws, and Malicious File Execution.

  5. Supports error tracking and internationalization.

  6. Multiple protocols readability.

  7. Employs successful software engineering practices that makes code easy to read and maintain.

  8. Ensure user-oriented advancements through backward compatibility.

web2py

Pyramid

Category −Pyramid 是一个非全栈框架

Category − Pyramid is a non-Full Stack Frameworks

Release - 1.9.2,发布于 2018-04-23

Release − 1.9.2, released on 2018-04-23

About - Pyramid 是一个紧凑、快速、务实的 Python Web 框架。它作为 Pylons 项目的一部分而开发。它在类 BSD 许可下获得许可。它使得现实世界的 Web 应用程序开发和部署变得更加有趣、更可预测,更高效。

About − Pyramid is a small, fast, down-to-earth Python web framework. It is developed as part of the Pylons Project. It is licensed under a BSD-like license. It makes real-world web application development and deployment more fun, more predictable and more productive.

Features of Pyramid

Python Pyramid 是开源的框架,有以下特色 -

Python Pyramid is an open sourced framework with the following features −

  1. Simplicity − Anyone can start to work with it without any prior knowledge about it.

  2. Minimalism − Quite out of the box, Pyramid comes with only some important tools, which are needed for almost every web application, may it be security or serving static assets like JavaScript and CSS or attaching URLs to code.

  3. Documentation − Includes exclusive and up to date documentation.

  4. Speed − Very fast and accurate.

  5. Reliability − It is developed, keeping in mind that it is conservative and tested exhaustively. If not tested properly, it will be considered as broke.

  6. Openness − It’s sold with a permissive and open license.

pyramid

Dash

Category - Dash 框架属于“其他”Python web 框架。

Category − The Dash framework belongs to “other” Python web frameworks.

Release - 0.24.1,Dash 核心后端。

Release − 0.24.1, core dash backend.

About - Dash 是一个用于创建交互式 Web 可视化的开源库。Plotly 团队创建了 Dash,这是一种利用 Flask、React.js 和 plotly.js 来构建自定义数据可视化应用程序的开源框架。该库的关键亮点是,您可以只通过 Python 代码构建高度交互的 Web 应用程序。数据科学家喜欢 Dash 框架,尤其是那些不太熟悉 Web 开发的人员。

About − Dash as an open source library for creating interactive web-based visualizations. The plotly team created Dash – an open source framework that leverages Flask, React.js and plotly.js to build custom data visualization apps. Key highlight of this library is that you can build highly interactive web application only through Python code. Data scientists love dash framework, specially all those who are less familiar with web development.

利用 Dash,开发人员可以访问所有可配置属性和底层 Flask 实例。利用 Dash 框架开发的应用程序可以部署到服务器中,而且最终呈现到 Web 浏览器中。

With Dash, developers get access to all the configurable properties and underlying Flask instance. The applications developed using Dash framework can be deployed to servers and are eventually rendered in the web browser.

Dash 应用程序天生跨平台(Linux/Win/Mac),且对移动设备友好,而且 Flash 插件的丰富集可以扩展应用程序的功能。

Dash applications are inherently cross-platform (Linux/Win/Mac) and mobile friendly and the capabilities of applications can be extended by the rich set of Flask Plugins.

dash

Features of Dash

  1. Provides access to configurable properties and Flask instance

  2. Through Flash plugins, we can extend the capabilities of the Dash application

  3. Mobile-ready