Django – Python web development framework
Django is a rich software framework suitable for developing complex sites and web applications, written in the Python programming language.
Django – framework for web applications in the language of the Python . One of the main principles of the framework is DRY (don’t repeat yourself). Django web systems are built from one or more applications, which are recommended to be alienated and plug-in. This is one of the noticeable architectural differences of this framework from some others (for example, Ruby on Rails ). Also, unlike many other frameworks, URL handlers in Django are explicitly configured (using regular expressions), and are not automatically set from the controller structure.
Django was designed to run under Apache (with the mod_python module) and using PostgreSQL as a database. Currently, in addition to PostgreSQL, Django can work with other DBMSs: MySQL ( MariaDB ), SQLite, Microsoft SQL Server, DB2, Firebird, SQL Anywhere and Oracle. To work with a database, Django uses its own ORM, in which the data model is described by Python classes, and a database schema is generated from it.
Django’s architecture is similar to Model-View-Controller (MVC) . The controller of the classic MVC model roughly corresponds to the level that Django calls the View, and the presentation logic of the View is implemented in Django by the Templates level. Because of this, the layered architecture of Django is often referred to as Model-Template-Presentation (MTV).
Initially, the development of Django was carried out to provide more convenient work with news resources, which had a significant impact on the architecture: the framework provides a number of tools that help in the rapid development of websites of an informative nature. For example, the developer does not need to create controllers and pages for the administrative part of the site, Django has a built-in content management application that can be included in any site made on Django, and which can manage multiple sites on one server at once. The administrative application allows you to create, modify and delete any content objects on the site, logging all the committed actions, and provides an interface for managing users and groups (with object-based assignment of rights).
The Django web framework is used in such large and well-known sites as Instagram, Disqus, Mozilla, The Washington Times, Pinterest, lamoda, etc.
Some features of Django:
- ORM, transactional database access API
- built-in administrator interface, with existing translations into many languages
- regex based URL manager
- extensible template system with tags and inheritance
- caching system
- plug-in application architecture that can be installed on any Django sites
- “Generic views" – controller function templates
- authorization and authentication, connection of external authentication modules: LDAP, OpenID and others.
- filter system (“middleware") for building additional request handlers, such as filters included in the distribution for caching, compression, normalization of URLs and support for anonymous sessions
- library for working with forms (inheritance, building forms according to the existing database model)
- built-in automatic documentation for template tags and data models, accessible through the administrative application
Some components of the framework are weakly related to each other, so they can be easily replaced with similar ones. But with some (for example, with ORM) this is not very simple. In addition to the features built into the core of the framework, there are packages that expand its capabilities.
Based on Django, a lot of ready-made solutions have been developed, distributed under a free license, including systems for managing online stores, universal content management systems , as well as more focused projects.