Django Framework

Django is a high-level Python Web framework that inspires fast development and clean, pragmatic design. Developed by expert developers, it takes care of much of the trouble of Web development, therefore you can concentrate on drafting your app without lacking to reinvent the wheel. It’s free and open source.

When you’re developing a website, you regularly require a related set of parts: a process to control user authentication (sign-up, sign-in, sign-out), a control panel for your website, forms, a way to upload files, etc.

Fortunately for you, other people long past noticed that web developers meet similar difficulties when developing a new website, so they pulled up and designed frameworks (Django being one of them) that provide you ready-made elements to use.

Frameworks live to save you from having to reinvent the wheel and to help relieve some of the burdens when you’re developing a new website.

Why do you need a framework?

To understand what Django is really for, we require to take a closer inspection at the servers. The prime concern is that the server requires to understand that you want it to serve you a web page.

Imagine a mailbox (port) that is controlled for incoming letters (requests). This is begun by a web server. The web server reads the letter and then sends an acknowledgment with a webpage. However, when you want to send something, you require to have some content. And Django is something that encourages you to create the content.

What happens when you request a website from your server?

When a request gets to a web server, it’s transferred to Django which attempts to decide what is requested. It needs a webpage address first and strives to figure out what to do. This role is done by Django’s URL resolver (note that a website address is called a URL – Uniform Resource Locator – hence the name URL resolver makes sense). It is not quite smart – it uses a catalog of patterns and tries to meet the URL. Django checks designs from top to bottom and if something is met, then Django transfers the request to the associated function (which is called view).

Assume a mail carrier with a letter. She is stepping down the road and checks every house number against the one in the letter. If it meets, she puts the letter yonder. This is how the URL resolver operates!

In the view function, all the exciting kinds of stuff are done: we can view a database to see some reports. Perhaps the user requested to change something in the data? Similar to a letter telling, “Please correct the information about my job.” The view can verify if you are entitled to do that, then update the job information for you and send back a message: “OK!” Then the view produces a response and Django can transfer it to the user’s web browser.

The information earlier is a little bit obvious, but you don’t require to understand all the technical information yet. Holding an overall idea is sufficient.

So rather of falling too much inside details, we will start building something with Django and we will learn all the major parts along the way!