I want to write url link in views, and then return to template.
views.py
for platform in platform_list:
if (fail_case.platform==platform):
html_front = "<a href=/home/%s/%s/%s>" % (build, run, fail_case.testResult_id)
html_back = "</a>"
brray.append(html_front + "X" + html_back)
else:
brray.append("")
below is the result(WIN7):
http://img9.imageshack.us/img9/6806/86730486.png
i want to let X be a link, but how can i write it in views.py?
I strongly advise against sending HTML from views. Templates are better suited to do this.
It looks like
Xis not a “link” as your template is escaping HTML characters. Look up the documentation on how to avoid this. This documentation link shows one way to achieve this. Inside your template you can use theautoescapetag. Something like this: