Although Python other than the dominant programming language, it still has a lot to offer, especially for those who want to start in the area. it is a dynamic and interpreted language, and therefore encourages exploratory and iterative development. Programming purists can point to the fact that object orientation was designed in Python from the start, rather than being adapted later to the language.
In addition to the language design considerations, the features incorporated in standard Python libraries are impressive. Python even installs itself with the web server itself. In addition, Python has many free database libraries, several free web page template systems and even libraries to interact with your favorite server – all ready to download and apply to your next web application project.
In the following paragraphs, we review six web application frameworks for the developer who wants to rely on Python. These are by no means the only web frameworks available in Python, but they represent a wide sample of the possibilities. No matter what your needs or inclinations are as a Python developer: one of these structures promises to be a good option.
They include Zope 2, a proud descendant of one of the oldest web server structures in any language; Web2py, a low abstraction structure that provides only the essentials for web development; Web.py, a top-level framework that provides its own integrated web-based development environment; Pyramid, a new flexible offering from the group that produced the popular Pylons structure; the popular and renowned Django framework; and CubicWeb, with which you can build not only web applications, but also semantic versions of those same apps.
Light, heavy and intermediate, Zope 2 is a descendant of Zope, the great-grandfather of all Python web application tools and an important branch of the language family tree. The rise of Zope 2 dates back to the mid-90s, and the continued popularity of Zope is a testament to its solidity. Consequently, a huge advantage in choosing Zope 2 is that you can use 15 years of code development and documentation.
The Zope 2 ?object publishing? system fits well into an object-oriented development mindset and slightly mitigates the learning curve you would have to climb if you chose a structure that exposes your application to the most painful aspects of web development . Zope 2 presents a formidable learning curve on its own, but you at least enjoy the stability that a 15-year-old pedigree confers.
The Web2py structure is an abstraction paradise. Databases are hidden behind a database abstraction layer (DAL). The Web2py rendering system will try to find a view that, depending on the context, displays an object in HTML, XML, JSON or any of the protocols supported by the framework. Created by a professor of computer science, Web2py's template system allows you to use Python as a scripting language embeddable in HTML. Tucked somewhere between the comprehensive world of Zope 2 and the minimalism of Pyramid, Web2py may well be the best framework for experienced Python developers to enter the world of developing framework-based web applications.
The philosophy of Web.py – a minimalist structure – does not abstract the details of interaction with the web, but facilitates this process. As a result, you will find yourself writing handlers for HTTP GET functions. Likewise, the Web.py database system does not abstract SQL, as instead of hiding the fact that you are querying a database, it hides the details of working with different databases. Web.py defines a template language, which, like Web2py, allows you to embed arbitrary Python code in a web page. Web.py is ideal if you are already familiar with creating web applications (you may have written CGI-based applications). You'll get started quickly with Web.py, but you'll need to trust yourself to go beyond the simplest applications.
Pyramid is also a minimalist structure, not so much in its capacity as in its philosophy. It does not make any claims about the back-end database that you should use, nor does it prevent a developer-specific model system.
If the Pyramid has any stains, the peculiar terminology with which its documentation describes the structure. In addition, your structure can make you wonder exactly how to proceed to perform a specific task – and, when you can accomplish that task, if your solution was the best. For example, there are two separate ways to determine how your application handles a given URL: the well-known URL mapping mechanism and something called ?traversal? (which you will need to read the documentation to find out). So with Pyramid, you gain flexibility at the cost of becoming something of an explorer.
Django is a more mature and highly regarded structure that assumes you know Python well. Its libraries provide a good selection of essential resources to accelerate the development of web applications: an object-relational mapper so you don't have to write your own RDBMS interface code, a system of templates so you don't have to struggle with matching Python content with static HTML content on a web page, an administrative interface so that you can easily access the site's back-end data (in addition to easily managing the site's users and permissions), and so on. You should spend time learning the Django API, but all that time is worth it.
CubicWeb presents itself not only as a web development framework, but also as a semantic web development framework. This distinction is clear when you discover that the interaction of a CubicWeb application with a database is accomplished through RQL (Relation Query Language), a query language similar to the W3C SPARQL for RDF. CubicWeb libraries convert RQL queries into SQL or XML or LDAP or any appropriate protocol for storing the data being accessed. CubicWeb is probably the most difficult structure to understand in this review.
The difficulty is not only in the jargon you must learn, but also because building a CubicWeb application involves tying modules (called cubes) into a final structure – a process that is foreign to the nephites. However, when you get the hang of it, CubicWeb allows for rapid development. A basic model schema sufficient to obtain an application from scratch, and CubicWeb's geometrical features allow iterative growth of the application.
Which to choose?
If you prefer a structure that puts the minimum between you and the web, Web.py will be your best choice. On the other hand, if you like assistants who guide you along the way, you may prefer Web2py. CubicWeb is an excellent option if your data comes from different sources. If the structure of your site is data driven, take a look at Pyramid or Zope 2. Furthermore, Zope 2 and Django are comprehensive and solid choices, both of which have stood the test of time.
But these are just general suggestions. It is not the case that any specific web structure in Python is at a significant disadvantage to the others. As always, the choice is highly subjective. You will find fans for each product, and every fan is able to present rational reasons why the chosen structure is superior.
Python Programming Course
Learn Python from basic to advanced and prepare to develop applications such as chatbots, automated tests, work with data mining, machine learning, web development and even artificial intelligence. The IT Trends network is an edtech that has the mission of preparing and educating professionals for the digital economy through information, analysis and courses. Click here to access.