Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a way to automatically detect links in Django templates?

I am passing in some lists from a view into a django template. In this template, it will extract strings from these lists in a sequence of for loops, and then print out each of these strings. Some of these strings may have URLs in them, like This is some string. http://google.com Right now when these strings are printed they are just printed as text. Is there a simple way to tell the django template to autolink these URLs and show these as links instead of plain text?

Thanks!

like image 338
mindthief Avatar asked Feb 25 '23 16:02

mindthief


1 Answers

Try with urlize template tag.

like image 75
Davor Lucic Avatar answered Mar 15 '23 23:03

Davor Lucic