django template link to dynamic url -


I try to create a list from a dictionary, where I have the name of the stored footage ( value1 ). So with every hit of the loop I can link to the right page. The problem is, I can not understand how I should fix {{url "view_name"}} .

My Template:

  & lt; Table & gt; & Lt; TR & gt; & Lt; th colspan = "2" & gt; Timer & lt; / Th & gt; & Lt; / TR & gt; {% For key, value in timer. Idems}} & lt; Tr & gt; & Lt; Td> {{Key}} & lt; / Td> & Lt; Td> & Lt; a href = "{{url values.1}}" & gt; {{Values.0}} & lt; / A & gt; & Lt; / Td> & Lt; / TR & gt; {% Endfor%} & lt; / Table & gt;   

How can I change the URL, from which it appears on value.1

: (Meditation Keep that idea name (now ',' small job ', [' now ',' short-job ']), (' middle job ') is still very much, but they are used on other occasions)

 , ('now', 'moderate_job')), ('long work', ['now', 'long_job']), ('alcohol', ['now', 'alcohol'] ), ('Drugs' [' now ',' drugs']), ('successor', ['now', 'successor]]), (' bullet deal ', [' now ',' bullet_del ']]] )    

< div class = "post-text" itemprop = "text">

url is a template tag and is not a variable, therefore changing:

  {{Url values.1}} In:  
  {% url values.1%}   

Should do the trick.

Comments

Popular posts from this blog

Java - Error: no suitable method found for add(int, java.lang.String) -

java - JPA TypedQuery: Parameter value element did not match expected type -

c++ - static template member variable has internal linkage but is not defined -