@register.simple_tag
def try_url(url_name):
 from warnings import warn
 warn(u"try_url is deprecated, use the url tag with the 'as' arg instead.")
 try:
  url = reverse(url_name)
 except NoReverseMatch:
  return u''
 return url

@ register . simple_tag def try_url ( url_name ) : from warnings import warn warn ( u"try_url is deprecated, use the url tag with the 'as' arg instead." ) try : url = reverse ( url_name ) except NoReverseMatch : return u'' return url
mimics djangos url template tag but fails silently .