Django is a high-level Python Web Framework that is built on the following principles:
1. Creating apps fast
2. Clean and pragmatic design with reusable code
3. Performance
4. Elegance
Django is an open source framework software that aids in the development of Python web apps that follows the Model-View-Controller architectural model.
The main purpose of this software framework created for web apps development is to facilitate the creation of complex, database-based websites. Django focuses on code re-use, modularity, rapid web site development, guided by the “do not repeat” principle.
Django is encoded from one end to other in Python, even the configuration files and data models are implemented in this programming language. Django also provides an administrative panel that, although pre-installed, is optional, and can easily create, read, update, and easily delete database information.
This admin panel is dynamically generated by introspection and can be easily configured through administrative data models.
MVC/MTV
Model-view-controller is a software design model used to implement user interfaces. It divides a software application into three interconnected parts so that the internal representation of the information can be separated from the way it is presented to the user.
Model
A model is a unique, definitive source of information about stored data. It contains the essential fields and the behavior of the data you store. In general, each model is mapped over a single database table.
1. Each model is a Python class that has the parent django.db.models.Model.
2. Each class attribute/field is a column in the associated table.
3. Each instance of the class represents a row in the related table.
4. Django offers a self-generated API for access to the database.
View/Template
Being a web framework, Django needs a convenient way to generate dynamic HTML. The most common approach is based on templates. A template contains the static parts of the desired HTML page as well as some special syntax elements describing how dynamic content will be inserted.
Controller/View
Django uses the “view” concept to encapsulate the logic responsible for processing a user’s request and returning the response. In Django, a view is a “web page type” that generally serves a specific function and template.
Administration interface
One of the most potent parts of Django is the automatic management interface. Use metadata from your models to provide a model-based quick interface where users can:
1. Face CRUD operations on data
2. Create superusers
3. Create other users, groups, and permissions
Django was created in 2003 at the Lawrence Journal-World newspaper in New York, where programmers Adrian Holovaty and Simon Willison began to develop – in Python – apps for quick articles publishing.
Django is in many respects the correspondent in Python of the Ruby on Rails web framework software. For example, both are guided by the DRY principle which is Do not repeat yourself.
In a purely Python way, Django emphasizes explicitly. For example, URL configuration is done explicitly by using regular expressions to express the URL and by manually correlating it with the function that handles requests coming to this URL. Other web frameworks are based on automatic URL generation based on the names of the features they manage.