try
<html>
{% if html_message %}{{ html_message|safe }}{% endif %}
</html>
but I would do:
{% if html_message %}
<h2> We recommend that you click <a
href="thing.get_update_url">here</a></h2>
{% endif %}
- Gennadiy <[email protected]>
2011/3/10 Thiago Carvalho D' Ávila <[email protected]>
> I'm having some problem while trying to render some HTML code as a template
> variable.
>
> What I am doing is:
>
> *view.py*
> def view(request, id):
> thing = get_object_or_404(Object, pk=id)
> if blablabla:
> return render_to_response('template.html'),
> {'html_message': '<h2> We recommend that you click <a
> href="thing.get_update_url">here</a></h2>'},
> }, RequestContext(request))
>
> *template.html*
> <html>
> {% if html_message %}{{ html_message }}{% endif %}
> </html>
>
> But I get the HTML tags written in the text, not the link.
> What am I doing wrong?
>
> Tks ;)
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to
> [email protected].
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/django-users?hl=en.