More about Django

Django is a popular web framework that is designed to simplify the development and deployment of web applications. It includes loads of boilerplate code for everyday tasks, such as database model management, frontend templating, session authentication, and security. Django was built around the Model-Template-View (MTV) design pattern.

The model is perhaps the most critical component of MTV. It refers to how you represent your data in terms of different tables and attributes. It also abstracts away the nitty-gritty details of different database engines such that the same model can be applied to SQLite, MySQL, and PostgreSQL. Meanwhile, the model layer of Django would expose engine-specific parameters, such as ArrayField and JSONField in PostgreSQL, for fine-tuning of your data representation.

The template is similar to the role of a view in the canonical MTV framework. It handles the presentation of data to the users. In other words, it doesn't handle the logic of how the data was generated.

The view in Django is responsible for handling a user's request, and the subsequent logic of returning a response. It sits between the model layer and the template layer. A view determines what kind of data should be fetched from the model and how to process the data for the template.

The key selling points of Django are as follows:

  • Development speed: Loads of key components are provided; this reduces the number of repetitive tasks in a development cycle. For instance, it takes mere minutes to build a simple blog using Django.
  • Security: Best practices of web security are included in Django. The risks of hacks such as SQL injection, cross-site scripting, cross-site request forgery, and clickjacking are greatly reduced. Its user authentication system uses the PBKDF2 algorithm with a salted SHA256 hash, which is recommended by NIST. Other state-of-the-art hash algorithms, such as Argon2, are also available.
  • Scalability: The MTV layers of Django use a shared-nothing architecture. If a certain layer is the bottleneck of the web application, just throw more hardware to it; Django will take advantage of the additional hardware for each of the layers.
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.118.142.17