What is the right way to do the template in Django/python?

Asked

Viewed 71 times

1

This has been my first contact with the framework and with mvc/mvt, and I’m in doubt, as a matter of good practices and tals, should I make a template for each of the views or should I just make a template and change the content dynamically through the views? The top and bottom of the pages will be the same, I just don’t know the best way to do it.

1 answer

1

You could make a base template where you would have navbar, footer, and recurring questions in other templates and use the Django templates system{% extends %} of Django to change certain parts such as title, content and etc.

You can take a look here: https://docs.djangoproject.com/en/2.0/topics/templates/

Browser other questions tagged

You are not signed in. Login or sign up in order to post.