What is a Web Framework?

A web framework is a code library which helps you to build a flexible, scalable, and maintainable; dynamic website, web app, and web services. Different web frameworks are Zend for PHP, Ruby on Rails for Ruby, etc. In this Python Django tutorial for beginners, you will learn

What is a Web Framework?
What is Django?
Why Django? Key Advantages of Django History of Django
Features of Django
Characteristics of Django
Django Architecture
Components of Django
Famous Companies Using Django
Disadvantages of using Django

History of Django

Now in this Django for beginners tutorial, let’s learn about features of Django.

Django is easy to set up and run. It offers a variety of options to get started It provides a ready-to-use user interface for administrative activities It enables multilingual websites by using its built-in internationalization system Helps you to meet the massive traffic demands quickly Django is used to build all types of content management systems, social networks as well as scientific computing platforms. Django helps you to provide end-to-end application testing Helps you to document your API with an HTML output REST Framework has rich support for several authentication protocols Permissions and throttling policies It is widely used for rate limiting API requests from a single user.

Now in this Django framework tutorial, we will learn about characteristics of Django.

Helps you to define patterns for the URLs in your application Simple but powerful URL system Built-in authentication system Object-oriented programming language database which offers best in class data storage and retrieval Automatic admin interface feature allows the functionality of adding, editing and deleting items. You can customize the admin panel as per your need. Cache framework comes with multiple cache mechanisms.

Next in this Django beginner tutorial, we will learn about the architecture of Django.

Loosely Coupled- Django helps you to make each element of its stack independent of the others. Less code- Ensures effective development Not repeated- Everything should be developed in precisely one place instead of repeating it again Fast development- Django’s offers fast and reliable application development. Consistent design- Django maintains a clean design and makes it easy to follow the best web development practices.

Now in this Django tutorials for beginners series, we will learn about components of Django.

MVC Pattern:

When talking about applications which provide UI (web or desktop), we usually talk about MVC architecture. MVC pattern is based on Model, View, and Controller. The Model defines the data structure and takes to care for querying the database. The View defines what data should be presented and returns an HTTP response. The Controller is that part of the application that handles the user interaction.

Django MVC-MVT pattern

The Model-View-Template (MVT) is a different concept compared to MVC. The main difference between these two architectural patterns is that Django itself manages the Controller part (software code that controls the interactions between the Model and View). The template is an HTML file which mixed with Django Template Language file which also called DTL. The below-given diagram shows how all the components of the MVT pattern interact with each other to serve specific to a user request. As seen in above diagram, a user requests for a resource to Django. Django acts as a controller and checks to the available resource in URL. If URL maps, a view is called which interacts with model and template. Django then responds to the user and sends a template as a response.

Components of Django

Form:

Django has a powerful form library which handles rendering forms as HTML. The library helps in validating submitted data and converting it to Python types.

Authentication:

It handles user accounts, groups, cookie-based user sessions, etc.

Admin:

It reads metadata in your models to provide a robust interface which can be used to manage content on your site.

Internationalization:

Django provides support for translating text into various languages, locale-specific formatting of dates, times, numbers, and timezones.

Security:

Django provides safeguard against the following attacks:

Cross-Site Request Forgery (CSRF) Cross-site scripting SQL injection Clickjacking Remote code execution

Famous Companies Using Django

Here, are companies which are using Django:

BitBucket DISQUS NASA PBS (Public Broadcasting Service) Pinterest Instagram Mozilla The Washington Post NY Times LA Times The Guardian National Geographic Discovery Channel

Disadvantages of using Django

A process cannot handle multiple requests simultaneously. Django is a very much monolithic tool. Components get deployed together which can create confusion. Knowledge of full system needed to work on Django Makes web application components tightly-coupled You need to do lengthy programming for minor tasks.

Summary

Django is a web development framework for Python which offers a standard method for fast and effective website development. Django started was by Adian Holovaty and Simon Willison as an internal project at Lawrence Journal-World newspaper in 2003 Django helps you to document your API with an HTML output. Django allows you to customize the admin panel as per your need. Django helps you to make each element of its stack independent of the others. The main difference between MVC and MVT architectural patterns is that Django itself manages the Controller part. Essential components of Django’s architecture are: Form, Authentication, Admin, Internationalization, Security. Bitbucket, DISQUS, Nasa, Pinterest, Instagram, Mozilla, etc. use Django The biggest drawback of Django is that it can’t handle multiple requests simultaneously.