📜 ⬆️ ⬇️

10 Python web frameworks to work with in 2018

image

From the translator: today we offer you a translation of an article posted on Hackernoon by SteelKiwi. She develops b2b and b2c software solutions, and she shares her experience gained in the process with her readers.

The frameworks make life easier for the developer by offering various solutions for developing applications and services. They automate the implementation of standard solutions, saving you time. Thus, the developer focuses on the application, and not on routine tasks where no creative thinking is needed.

Skillbox recommends: Practical course "Python-developer from scratch . "
We remind: for all readers of "Habr" - a discount of 10,000 rubles when recording for any Skillbox course on the promotional code "Habr".

This article describes ten Python frameworks that will be useful for both novice developers and professionals. In 2018, the old frameworks were updated, new tools appeared that are worth paying attention to.
')

Before you begin ...


When you start to choose a framework, estimate the size and complexity of your project. If what you are developing is a large system with a fair amount of functions, then the full-stack framework is what you need. If you are creating a relatively small application or service, then you should pay attention to microformwork.

Information about some frameworks is presented on the pages of Wikipedia . The final decision, however, you must make on the basis of the principles of analysis of your own service or application, already voiced above.

Full-stack frameworks


Django



Django is a free open-source full-stack framework. It allows you to add most of the standard functions as a single package instead of searching for individual libraries.

Among them are such popular ones as authentication, URL routing, data scheme migration, etc.

Django uses ORM to map objects to database tables. The same code works with different databases, so switching from one database to another becomes a simple task. The main databases with which Django works are PostgreSQL, MySQL, SQLite and Oracle. You can add others, but this will require third-party solutions.

Pyramid



Pyramid is an open-source framework that gives a developer the maximum opportunity with minimal time and resources.

The most interesting feature of the framework is working with both large and small applications. Separately, it is worth to highlight such Pyramid functions as:


Turboears



TurboGears is an open-source full-stack framework for web applications. It allows the developer to quickly create extensible, data-driven web applications. TurboGears comes with convenient templates and a powerful and flexible ORM.

The most important functions of the framework:


Web2py



And this is a scalable open-source full-stack framework for Python. But before you start working with it, you should remember that it is incompatible with Python 3.

But Web2py comes with its own IDEwhich: it has a code editor, a debugger and a deployment in one click. Among other functions and tools, the following should be highlighted:


Microframes


Flask



This is a microfragment, which is licensed under the BSD license. Its developers were inspired by the Sinatra Ruby framework. It depends on the Werkzeug WSGI toolkit and the Jinja2 template.

Flask has a modular design that allows you to adapt it for many tasks. Out of the box, the developer receives the following functions:


A framework was created to support web application developers who were able to choose extensions to their liking.

Bottle



Another microframe, which was originally intended to create an API. Bottle is distinguished by the presence of a single source file. Work with him does not require "dancing with a tambourine."

Its default features include routing, patterns, utilities, and a basic abstraction according to the WSGI standard:


This is an excellent solution for prototyping, studying the structure of web frameworks and creating small applications.

Cherrypy



CherryPy is a minimal open source web framework. It provides the ability to create Python web applications that are no different from building any other object-oriented program.

In fact, this web application running under CherryPy is a standalone Python application using its own multi-threaded web server. CherryPy applications run on any operating system that supports Python (Windows, MacOS, Linux, etc.). They can be deployed in any environment where you can run a regular Python application. You do not need Apache for CherryPy applications, you can run the CherryPy application in Apache, just like in Lighttpd or IIS.

CherryPy allows you to use any type of technology for templating, accessing data, etc. It can also handle articles, statics, cookies, upload files and everything else that other frameworks can do.

His distinctive abilities:


Asynchronous frameworks


Sanic

Sanic - Python-framework, which is built on uvloop and designed for quick processing of HTTP requests.

It works on Python 3.5+. Sanic supports asynchronous request handlers, making it compatible with the async / wait functions of Python 3.5. This greatly increases the speed of work.

In the benchmark, when processing 100 connections, Sanic showed the ability to process 33,342 requests per second.

Tornado



Tornado is a Python web framework and asynchronous network library at the same time. It uses non-blocking network I / O and solves the C10k problem (this means that if configured correctly, it can handle 10,000+ simultaneous connections).

All this makes it an excellent tool for creating applications that require high performance and work with tens of thousands of users at the same time.

Main advantages:


Bonus


Dash



Dash is an open source Python framework used to create analytical web applications. It is especially good for big data specialists who are not very familiar with web development.

Dash applications are web servers that launch Flask and exchange data with JSON packages over HTTP. Their interface provides components with React.js capabilities.

Applications developed with Dash are displayed in a web browser and can be deployed on servers. Dash applications are cross-platform in nature.

As a conclusion, we can say that developers are really offered a lot of frameworks. Each of them gives its own unique features. But choosing a framework is an important decision for the future of your own project, and you should not rush into it.

Skillbox recommends:

Source: https://habr.com/ru/post/420119/


All Articles