What is Django?

What is Django?

Django is a free and open-source web application framework, written in Python. A web framework is a set of components that help you develop an easier and faster website.

When we are building a website, we always need a similar set of components: a way to handle user authentication (signing up, signing in, signing out), a management panel for our website, forms, a way to upload files, etc.

Django is one of them that will provide ready-made components to use for developing web applications.

Frameworks exist to save you from having to reinvent the wheel and to ease some of the overhead when you're building a new site.

Why do we need a Framework?.

To understand what Django really is, we should take a more intimate look at the servers. The first thing that the server needs to know is that we want a web page to serve you.

In a complete perspective, the answer to this question is we use frameworks because:

  • It will decrease effort
  • To manage core language principles.
  • Can only deal with the purpose of that framework you cannot use it for everything
  • We can still combine anything easily through the built-in API of that framework.

Let us imagine a mailbox that is controlled for incoming letters. This is done by a web server. The web server reads the letter and then sends a response with a web page. But when we want to send something, we need to have some content. And Django is something that helps you create content.

What happens when someone requests a website from a server?

When a request comes to a web server, it is passed to Django, which tries to decide out what is really requested. It uses a web page address first and tries to figure out what to do for this. This is a part done by the Django URL resolver. It is not very smart – it takes a list of patterns and tries to match the URL. Django match patterns from top to bottom, and if something is matched, then Django passes the request to the associated function (which is known as a view).

Imagine a mailman with a letter. She walks down the street and checks the number of each house with that of the letter. If it matches, she puts the letter there. This is how URL resolver works.

Example of using Django 

  1. Disqus :- It allows you to implement comments and discussion options on your site, analyze audience activity and customize ad delivery. Using the Django framework, it allows the team to not only create the website quickly, but to keep scaling it for millions of new users.
  2. Instagram :- It is the most famous and fast-growing social networks, Instagram is another example of a website built with Python+Django
  3. Spotify :- Like iTunes, Spotify changed the way people listen, share and buy music. By using it, we can access music library from anywhere and on any device.
  4. Youtube :- The site that clearly needs no introduction. It was first created with PHP, but the rapid growth of the audience and the need to implement new functions quickly led the team to join the Django community.
  5. DropBox:-  It is  most popular cloud-based storage app for documents, video, graphics, and so on. We can access our files anywhere and from any device