Coding With Fun
Home Docker Django Node.js Articles Python pip guide FAQ Policy

About Django


May 14, 2021 Django



About Django

Django is a free open source Web framework developed with Python that can be used to quickly build high-performance, elegant websites! The framework mode of MVC is adopted, namely model M, view V and controller C, also known as MVT mode, model M, view V, template T.

It was originally developed to manage some of Lawrence Publishing Group's news content-based sites, and was announced under a BSD license in July 2005.

The frame is named after Belgian gypsy jazz guitarist Django Reinhardt.

Django's primary goal is to make it easy to develop complex, database-driven websites. D jango focuses on component re-use and "plugability," agile development, and the DRY law (Don't Repeat Yourself). Python is widely used in Django and even includes configuration files and data models.

Django officially established the Foundation on June 17, 2008.

Django architecture analysis

About Django

Part of the Django framework

The core of the Django framework includes:

  • An object-oriented mapor that is used as media between the data model (defined as a Python class) and the relationship database;
  • A URL distributor based on regular expressions;
  • A view system for processing requests;
  • A template system.

The core framework also includes:

  • A lightweight, stand-alone Web server for development and testing.
  • A form serialization and validation system for conversion between HTML forms and data suitable for database storage.
  • A caching framework with several caching options.
  • Middleware support that allows interference at all stages of request processing.
  • The built-in distribution system allows components in an application to communicate with each other using predefined signals.
  • A serialized system that can generate or read instances of the Django model represented by XML or JSON.
  • A system that extends the capabilities of the template engine.

Django contains a number of applications in its contrib package, including:

  • A scalable authentication system
  • Dynamic site management page
  • A set of tools that produce RSS and Atom
  • A flexible review system
  • Tools that produce Google Sitemaps
  • Tools to prevent cross-site request forgery
  • A library of templates that support lightweight markup languages (Textile and Markdown).
  • A basic framework to assist in the creation of geographic information systems (GIS).

Django's built-in app

  • Django contains a lot of applications in its "contrib" package, which contains:
  • A scalable certification system;
  • Dynamic site management page;
  • A set of tools that produce RSS and Atom;
  • A flexible comment system;
  • Tools that produce Google Sitemaps;
  • Tools to prevent cross-site request forgery;
  • A library of templates that support lightweight markup languages (Textile and Markdown);
  • A basic framework to assist in the creation of geographic information systems (GIS);

A summary of Django's strengths and weaknesses

The advantages of Django

  • Perfect documentation, Django's near-perfect official documentation.
  • Powerful URL routing configuration, Django lets you design very elegant URLs.
  • Self-service management background, so you have a complete background management interface with almost no need to write a line of code.
  • A full set of solutions (full-stackframework and batteries included), basically what to do (e.g. cache, session, feed, orm, geo, auth), and all Django made their own, the development of the site's tools Django basically give you a good job, so development efficiency is not to say.

Django's shortcomings

  • Template is weak and can't insert Python code, and to write more complex logic you need to implement Tag or Filter with Python.
  • URL configuration is powerful, but all to be handwritten, master and first-time django people with the URL will be very different.
  • The own ORM is far less powerful than SQL Alchemy, the de facto ORM standard in the Python world, and other frameworks support SQL Alchemy, but Django still sticks to his set.
  • Django's auth is closely integrated with other modules, the function is also quite strong, but do a little too much, the user's database schema has been set for you, such as many websites require email address unique, but schema in this field value is not unique.
  • System tight coupling, if you think Django built-in features are not very good, it is difficult to use your favorite third-party library instead, such as ORM, Template. It's almost impossible to use SQL Alchemy or Mako in Django, and even with some patches, it can be very, very awkward.