[Answer]-Django – same html, different views

1👍

Daniel is refering to an Inclusion Tag

Basically, a custom template tag is used for scenarios like yours (… code reusability amongs many other advantages)

Also this post might be helpful: Django Custom Inclusion Tags

Another approach could be using template inheritance – create a base template, which defines the layout, and override the blocks of code that would change for specific views.

Here is an example of template inheritance: https://docs.djangoproject.com/en/dev/topics/templates/#template-inheritance

0👍

Use a custom template tag – probably an inclusion tag.

Leave a comment