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 ope
You can add a custom filter, as described here:
I used this one:
# /templatetags/url_target_blank.py
from django import template
register = template.Library()
def url_target_blank(text):
return text.replace('
Example of usage:
{% load url_target_blank %}
...
{{ post_body|urlize|url_target_blank }}
Works fine for me :)