Django Nested Tags

I use the QR code library (Django), and when I do {% qrcode_from_text "{% url 'foo' %}" "l" %}, the internal tag gives an error. Is there any way to make such nested django template tags? Thank.

+4
source share
1 answer

No, but you don’t need it. The tag urlhas syntax for storing the result in a variable:

{% url 'foo' as foo_url %}

and you can use it in your custom tag:

{% qrcode_from_text foo_url %}
+11
source

Source: https://habr.com/ru/post/1539780/


All Articles