@register.filter
@stringfilter
def url_target_blank(text):
 return mark_safe(text.replace('<a ', '<a target="_blank" '))

@ register . filter @ stringfilter def url_target_blank ( text ) : return mark_safe ( text . replace ( '<a ' , '<a target="_blank" ' ) )
sets the target="_blank" for hyperlinks .