B
B
bituke2021-06-15 11:48:45
Django
bituke, 2021-06-15 11:48:45

How to make django template tag from html document?

Good afternoon!!
In one of the projects that was sent to me, the following functionality was used:
there were two html documents, for example, the first document:

tag.html
<h1>15</h1>

The second document is supposed to use the first one as a django templating tag:
<h2> Всего в мире за последний год появилось {% tag %} новых профессий.</h2>

tell me how it's done, or what is it called? Thank you!

Answer the question

In order to leave comments, you need to log in

2 answer(s)
D
Denis Melnikov, 2021-06-15
@bituke

Done through
{% include 'tag.html' %}

S
Stefan, 2021-06-15
@MEDIOFF

https://docs.djangoproject.com/en/3.2/howto/custom...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question