I have this requirement in django template:
{% if user.is_admin %}
<a href='{% url 'url_to_admin' %}'>admin url</a>
{% else %}
<a href='{% url 'url_to_other %}'>other url </a>
{% endif %}
and now, I want let it more simple, I want let url
to a variable `xx', like this:
if user.is_admin:
myurl = {% url 'url_to_admin' %}
else:
myurl = {% url 'url_to_other' %}
<a href={{myurl}} > url </a>
But I don't know how to write in django's template?