Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Nested Django tags

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

like image 472
Pierrew Avatar asked May 08 '14 15:05

Pierrew


1 Answers

No, but you don't need to. The url tag has a syntax to save the result to a variable:

{% url 'foo' as foo_url %}

and you can then use that in your custom tag:

{% qrcode_from_text foo_url %}
like image 108
Daniel Roseman Avatar answered Oct 19 '22 19:10

Daniel Roseman