I created a custom that accepts a Template Tags: update_line.html : The problem is that Can get it? Just after posting the question, just find out: My included Instead of using update_line.html : I believe this is the right way to do (DJAgro 1.5+): < / P> update_line.html : update model object
@ register.includetag ('update_line.html') def update_line (update): return {'update ': Update}
& lt; Tr & gt; & Lt; Td class = "update" & gt; {{Update}} & lt; / TD & gt; & Lt; Td square = "acc" & gt; & Lt; Img id = "update - {{update.pk}}" class = "ack-img" src = "{{STATIC_URL}} img / acknowledge.png" alt = "accept" /> & Lt; / Td> & Lt; / TR & gt;
{{STATIC_URL}} my included template is not available in the template, even if I use the
django.core I am doing Context_processors.static reference processor is therefore available for all my 'normal' templates so that
{{STATIC_URL}} is not being processed through an inclusion templates tag.
{{STATIC_URL}} in the templates, I use tags from
get_static_prefix
Fixed template tag:
{% load constant%} & lt; Tr & gt; & Lt; TD class = "update" & gt; {{Update}} & lt; / Td> & Lt; Td square = "acc" & gt; & Lt; Img id = "update - {{update.pk}}" class = "ack-img" src = "{% get_static_prefix%} img / acknowledge.png" alt = "accept" /> & Lt; / Td> & Lt; / TR & gt;
Update
{% load staticfiles%} & lt; Tr & gt; & Lt; Td class = "update" & gt; {{Update}} & lt; / TD & gt; & Lt; Td square = "acc" & gt; & Lt; Img id = "update - {{update.pk}}" class = "ack-img" src = "{% static 'my_app / img / acknowledge.png'%}" alt = "accept" /> & Lt; / TD & gt; & Lt; / TR & gt;
Comments
Post a Comment