Web frameworks

In the modern development of web applications, different frameworks are used, which are tools that give us a working scheme and a series of utilities and functions that facilitate and abstract us away from the construction of dynamic web pages.

In general, frameworks are associated with programming languages (Ruby on Rails (Ruby), Symphony (PHP)) in the Python world. The most well-known one is Django, but Flask is an interesting option that may not have such a high learning curve. It allows us to create web applications that are just as complex as those that can be created in Django.

A web framework is a layer that sits between the web server and our Python code, which provides abstractions and streamlined APIs to perform many of the common operations of interpreting HTTP requests and generating responses. Ideally, it is also structured so that it guides us into employing well-tested patterns for good web development. Frameworks for Python web applications are usually written in Python, and can be considered part of the web application.

The basic services a framework provides are as follows:

There are many Python web frameworks in use today, and here's a non-exhaustive list of some popular ones:

An up-to-date list of frameworks is maintained at http://wiki.python.org/moin/WebFrameworks and http://docs.python-guide.org/en/latest/scenarios/web/#frameworks.

Some frameworks provide the minimum to quickly build a simple web application. These are often called micro frameworks, and one of the most popular is Flask. Although they may not include the functionality of some of the heavyweight frameworks, they provide hooks to allow for the easy extension of more complex tasks. This allows a fully customizable approach to web application development.

Other frameworks take a much more batteries-included stance, providing all the common needs of modern web applications. The major contender here is Django, which includes everything from templating to form management and database abstraction, and even a complete out-of-the-box web-based database admin interface. TurboGears provides similar functionality by integrating a core micro framework, with several established packages for the other features.

However, other frameworks provide features such as supporting web applications with an event-driven architecture, including Tornado and CherryPy. Both of these also feature their own built-in production-quality web servers.

Here, we have provided a small description for some of these frameworks: