I'm developing a custom Django template tag that requires multiple arguments. One of those arguments is a URL. When I try to do this:
{% my_tag arg1 {% url "myview" %} arg3=5 %}
I get the following template syntax error: Could not parse the remainder: '{%' from '{%'
How can I pass a URL to a custom template?
Simple url tag supports assignment.
{% url 'myview' as my_url %}
{% my_tag arg1 my_url arg3=5 %}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With