Reputation: 110093
Is there a template filter in django that does the following:
text = 'hello please visit this site: www.google.com.'
And turns it in the template to:
hello please visit this site: <a href="www.google.com">www.google.com</a>.
Upvotes: 0
Views: 90
Reputation: 10305
Yes there is a template filter does this job
{{ text|urlize }}
If text
variable is "hello please visit this site: www.google.com",
And the output will be
"hello please visit this site: <a href="www.google.com" rel="nofollow">www.google.com</a>"
.
Update : Click here for target="_blank"
Upvotes: 1