Templates doubt

Please explain concept of templates again.

Hello @vatsal50, In Django, we use MVC architecture, and we need to use templates to show our frontend design or what we want the user to display.
We generally write about the models, or we can say about the objects or database tables inside the models.py
We use views.py to define the type of function or the functionality we want to achieve using our models; in simple terms, we define our logic here.
We use urls.py to redirect the user what he or she will gonna see on that particular link.
So the thing we want the user to see on the given link is going into the reverse direction, we go to the URL, then those URLs call the particular functions defined in the views and views generally uses the models to define these functions.

But all I have said this is the basics of what is happening in the backend side, but for the frontend, we need to create some HTML pages to view them on the web. Now comes the turn of templates, we need to define the templates’ location from where we are going to fetch those HTML pages or where we are gonna store them, so that’s why we first define the location of templates folder inside the settings.py. And then we store those HTML pages and fetch them into the views.py to define what functions will run on these pages.

I hope both it is clear to you, if there is any confusion pls let me know.
Please mark it as resolve and feel free to provide the feedback if it is clear to you.
Thanks :slight_smile:

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.