@register.tag
def app_reverse(parser, token):
 bits = token.split_contents()
 if (len(bits) < 3):
  raise TemplateSyntaxError((u"'%s' takes at least two arguments (path to a view and a urlconf)" % bits[0]))
 viewname = parser.compile_filter(bits[1])
 urlconf = parser.compile_filter(bits[2])
 args = []
 kwargs = {}
 asvar = None
 bits = bits[3:]
 if ((len(bits) >= 2) and (bits[(-2)] == u'as')):
  asvar = bits[(-1)]
  bits = bits[:(-2)]
 if len(bits):
  for bit in bits:
   match = kwarg_re.match(bit)
   if (not match):
    raise TemplateSyntaxError(u'Malformed arguments to app_reverse tag')
   (name, value) = match.groups()
   if name:
    kwargs[name] = parser.compile_filter(value)
   else:
    args.append(parser.compile_filter(value))
 return AppReverseNode(viewname, urlconf, args, kwargs, asvar)

@ register . tag def app_reverse ( parser , token ) : bits = token . split_contents ( ) if ( len ( bits ) < 3 ) : raise TemplateSyntaxError ( ( u"'%s' takes at least two arguments (path to a view and a urlconf)" % bits [ 0 ] ) ) viewname = parser . compile_filter ( bits [ 1 ] ) urlconf = parser . compile_filter ( bits [ 2 ] ) args = [ ] kwargs = { } asvar = None bits = bits [ 3 : ] if ( ( len ( bits ) >= 2 ) and ( bits [ ( - 2 ) ] == u'as' ) ) : asvar = bits [ ( - 1 ) ] bits = bits [ : ( - 2 ) ] if len ( bits ) : for bit in bits : match = kwarg_re . match ( bit ) if ( not match ) : raise TemplateSyntaxError ( u'Malformed arguments to app_reverse tag' ) ( name , value ) = match . groups ( ) if name : kwargs [ name ] = parser . compile_filter ( value ) else : args . append ( parser . compile_filter ( value ) ) return AppReverseNode ( viewname , urlconf , args , kwargs , asvar )
returns an absolute url for applications integrated with applicationcontent the tag mostly works the same way as djangos own {% url %} tag:: {% load applicationcontent_tags %} {% app_reverse "mymodel_detail" "myapp .