The Training Program of Build Web App with Python Django
Django is a free and open-source web framework, written in Python, which follows the model-view-template (MVT) architectural pattern. It is maintained by the Django Software Foundation (DSF), an independent organization established as a 501(c)(3) non-profit.
Django's primary goal is to ease the creation of complex, database-driven websites. Django emphasizes reusability and "pluggability" of components, rapid development, and the principle of don't repeat yourself. Python is used throughout, even for settings files and data models.
Django also provides an optional administrative create, read, update and delete interface that is generated dynamically through introspection and configured via admin models.
Despite having its own nomenclature, such as naming the callable objects generating the HTTP responses "views", the core Django framework can be seen as an MVC architecture.
It consists of an object-relational mapper (ORM) that mediates between data models (defined as Python classes) and a relational database ("Model"), a system for processing HTTP requests with a web templating system ("View"), and a regular-expression-based URL dispatcher ("Controller").
Also included in the core framework are:
- A lightweight and standalone web server for development and testing
- A form serialization and validation system that can translate between HTML forms and values suitable for storage in the database
- A template system that utilizes the concept of inheritance borrowed from object-oriented programming
- A caching framework that can use any of several cache methods
- Support for middleware classes that can intervene at various stages of request processing and carry out custom functions
- An internal dispatcher system that allows components of an application to communicate events to each other via pre-defined signals
- An internationalization system, including translations of Django's own components into a variety of languages
- A serialization system that can produce and read XML and/or JSON representations of Django model instances
- A system for extending the capabilities of the template engine
- An interface to Python's built-in unit test framework
The main Django distribution also bundles a number of applications in its "contrib" package, including:
- An extensible authentication system
- The dynamic administrative interface
- Tools for generating RSS and Atom syndication feeds
- A site's framework that allows one Django installation to run multiple websites, each with their own content and applications
- Tools for generating Google Sitemaps
- Built-in mitigation for cross-site request forgery, cross-site scripting, SQL injection, password cracking and other typical web attacks, most of them turned on by default
- A framework for creating GIS applications
Table of Content