the urlize function from django.utils.html converts urls to clickable links. My problem is that I want to append a target=”_blank” into the “< href..>”, so that I open this link in a new tab. Is there any way that I can extend the urlize function to receive an extra argument? or should I make a custom filter using regexes to do this stuff? Is this efficient?
the urlize function from django.utils.html converts urls to clickable links. My problem is that
Share
There is no capability in the built-in
urlize()to do this. Due to Django’s license you can copy the code ofdjango.utils.html.urlizeanddjango.template.defaultfilters.urlizeinto your project or into a separate app and use the new definitions instead.