Python web frameworks integrate with each other, and pyramid or replace Django

Source: Internet
Author: User

After using Django for a long time, it is inevitable that the degree of freedom is insufficient. It is undeniable that the sacrifice of such degrees of freedom can bring some benefits. For example, an Integrated Framework (full-stack framework) can provide comprehensive solution. You do not need to worry about cache, session, feed, Orm, auth, template, and other problems, it can be used in full accordance with Django's design philosophy. Using Django can quickly develop applications, and the unification of technology is undoubtedly a good thing for team development. Team members do not need to make too many arguments about the technical selection. Django has already helped us to fix it, just do it.

However, while providing a comprehensive solution, Django built itself into a closed framework. Because all components are implemented on their own, they may not do well in every aspect (although adequate ). At the same time, for ease of use, Django components are tightly coupled, and it is difficult for you to replace a component with your favorite library. For example, the most criticized orm and template of Django, if you want to replace it with sqlalchemy and Mako, it is almost impossible. Even if you barely use it, it will make you very awkward.

To talk about the world's major events, we must combine them for a long time. In the Warring States Period of Python web framework, Django was almost the only one. However, if other frameworks are combined vertically, they may not compete with Django.
This fusion trend is now apparent, and Django will disappear from the dust of history even if it is powerful. If you don't believe it, we can trace the truth. It's not hard to see that this kind of fusion begins with a more powerful split of Zope.

Several Python web frameworks have been listed in wsgi. Zope is an alternative because Zope is very heavy and suitable for organizing large-scale development and building complex applications. In order to face higher complexity, Zope provides a component framework zca (Zope component ure) that introduces the interface concept so that complex systems can be developed based on interfaces. Zca provides adapter components for assembling components of the entire application, as well as reusable tool components and event components. Zca is the most valuable product in Zope.

Although zca can assemble functions provided by Zope, such as authentication, object Publishing, transaction management, and authorization, these functions are still difficult to use outside Zope. So we have a repoze project. The goal of repoze is to split Zope's functional components so that other Python web applications can use them. Here, we can't help but feel the significance of wsgi: wsgi defines the interaction protocol between Web servers, web applications, and Web middleware, as long as it supports wsgi, various Web servers, web applications, and middleware can be interconnected. Repoze encapsulates Zope components according to wsgi, so that the Python web framework following wsgi can easily use these components.

Initially, repoze launched its own very lightweight Web Framework: repoze. BFG. Zca features are used in repoze. BFG. As a result, the Python web framework world has more power. But it is precisely this inconspicuous little force that has promoted the historical process. Repoze. similar to pylons, BFG is almost completely free. You can specify the data persistence layer, template system, and other peripheral parts at will, at its core, it defines how URLs are mapped to views.CodeAnd how to call the view. In this process, the wsgi specification is fully followed. Later, the developer of repoze. cfg decided to merge it into pylons. As a result, the merging of Python web frameworks started. The merged framework is called pyramid. Coincidentally, turbogears Based on pylons also announced the development of pyramid-based branches.

At this point, the chaotic world has seen a unified hope. I believe that more and more Python web frameworks will be integrated or at least interconnected. Perhaps, with the emergence of a more open framework, Django will gradually fade out of everyone's field of view. Let's wait and see.

Related Article

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.