djangoLogo - django Tutorial - Edureka

Django is an open source web framework which was named after Django Reinhardt. 

It follows the principle of “Don’t Repeat Yourself”.  As the name says, this principal is all about keeping the code simple and non repeating. Django is also a high level, MVT architect which stands for Model View Template.

Is Django easy to learn?

Django is very easy to learn and get started with. You can learn Django in a couple of weeks, however to become really good at Django you will need time and you will need to build projects.

Why Web Framework and Why Django?

Before Django, let’s first understand why do we need a web framework ? A web framework is a server-side application framework which is designed to support the development of dynamic websites. With the help of a framework, you don’t have to handle the hassles of web development and its various components. Therefore, it makes the life of a web application developer much easier as they don’t have to code from scratch. There are various web development frameworks available in the market. Some of them are listed below :

One of the highlights of Django is that it is built on python. From several years python has been the most popular programming language and continues to be a favorite among the skilled programmers. Hence, Django delivers transparent and high-quality code writing, making it important for the developers as well as the customers. It has various other advantages as it has an automatic administration interface, Object-relational mapper(ORM) and many more. So let’s understand what exactly it is.

Learn About Django Architecture : Watch video

Django Architecture

Django follows a MVC- MVT architecture .

MVC stands for Model View Controller. It is used for developing the web publications, where we break the code into various segments. Here we have 3 segments, model view and a controller.

mvc - Django Tutorial - Edureka

Model –  Model is used for storing and maintaining your data. It is the backend where your database is defined.

Views – In Django templates, views are in html. View is all about the presentation and it is not at all aware of the backend. Whatever the user is seeing, it is referred to a view.

Controller – Controller is a business logic which will interact with the model and the view.

Now that we have understood MVC, lets learn about Django MVT pattern.

MVT stands for Model View Template. In MVT, there is a predefined template for user interface. Let’s take an example, say you want to write several static html forms like hello user 1, hello user2 and so on. With template, you will be having only one file that prints hello along with the variable name. Now this variable will be substituted in that particular template using some jinja logic. That’s the magic of template, you don’t need to rewrite the code again n again!

Now you might be wondering where is the controller?

In the case of MVT, Django itself takes care of the controller part, it’s inbuilt.

Moving ahead in Django tutorial, let’s understand how things work internally.

In the above image, template is your front end which will interact with the view and the model will be used as a backend. Then view will access both the model and the templates and maps it to a url. After that, Django plays the role of controller and serves it to the user.

Now that you understand the architecture or how Django works internally, let’s move ahead in Django tutorial and install Django in our systems.

How to install Django

Is Django frontend or backend?
  • Neither, Django is a framework, Python is the language in which Django is written.
  • For the front end, Django helps you with data selection, formatting, and display. It features URL management, a templating language, authentication mechanisms.
  • For the backend, Django comes with an ORM that lets you manipulate your data source with ease, forms to process user input and validate data and signals, and an implementation of the observer pattern.

One Reply to “What is Django?”

Leave a Reply

Your email address will not be published.