This content originally appeared on DEV Community and was authored by Priyanshu Panwar
This is the second blog of my series Everything About Django. You can read my previous article here.
In this article, we are going to learn the core architecture of Django, how Django works.
Architecture of Django
Django follows the architecture MVT - Model View Template.
Let's break the MVT architecture :
- Model : This is the database layer of the architecture. Model means the tables stored in the database. Django follows the ORM (Object Relational Mapping) Protocol by which we can write the database commands in pythonic way without any SQL. We will study this in detail in coming blog.
- View : This is the logical layer of the architecture. This is where we write the logic of our project. We create functions/classes which are mapped to different URL Patterns of our site (project).
- Template : This is the display layer of the architecture. This contains the html files that are rendered(displayed) on our web interface. Every view(function/class) sends a template or a http response.
Let's take a look at this picture for clear understanding.
Let's drop this into few points:
- A user opens a specific url of our site (project) suppose http://localhost:8000/login
- Django maps this url to the specific view (function) which implements the logic for this url.
- The view takes the data from associated models (database) and sends a template which is rendered on the web interface.
I hope the MVT architecture of Django is clear. Feel free to comment your doubts.
THANK YOU
You can find me at : My Portfolio | LinkedIn
This content originally appeared on DEV Community and was authored by Priyanshu Panwar

Priyanshu Panwar | Sciencx (2021-11-07T10:28:05+00:00) Everything About Django – 2 (Architecture of Django). Retrieved from https://www.scien.cx/2021/11/07/everything-about-django-2-architecture-of-django/
Please log in to upload a file.
There are no updates yet.
Click the Upload button above to add an update.