How to assign a url to a variable in a template? I tried:
{% with url_news = url 'news' %}
and
{% with url 'news' as url_news %}
Use as parameter of url tag
as
url
{% url 'news' as the_url %} {% if the_url %} <a href="{{ the_url }}">Link to optional stuff</a> {% endif %}
Note that using this syntax will fail if the URL cannot be resolved.
Source: https://habr.com/ru/post/1483746/More articles:Getting string creation timestamp in MySQL from metadata? - sqlHow to get uri request using jstl in spring mvc project? - springDefining inheritance relationships between types of erasable classes - c ++InvalidStateError when opening IndexedDB in Firefox 21 - javascriptHTML email addresses with multiple links not showing up in hotmail - htmlImage C # Caption - c #Nginx - redirecting www.example.com/test to www.example.com//000/ - nginxIs it possible to use sublime text to create a complex Java application? - javaHow does AnimationTimer work? - animationCall Tree in Intelllij - javaAll Articles