1 import urlparse
2 from django.template import Library
3 from django.templatetags.future import url, URLNode
4 from django.contrib.sites.models import Site
5
6 register = Library()
7
9 - def __init__(self, view_name, args, kwargs, asvar, legacy_view_name=True):
16
27
29 """Just like {% url 'urlname' %} but ads the domain of the current site."""
30 node_instance = url(parser, token)
31 return AbsoluteURLNode(view_name=node_instance.view_name,
32 args=node_instance.args,
33 kwargs=node_instance.kwargs,
34 asvar=node_instance.asvar,
35 legacy_view_name=node_instance.legacy_view_name)
36
37 absurl = register.tag(absurl)
38