from django import template import re register = template.Library() @register.filter def siteabsoluteurl(absoluteurl, request): """ receives an argument in the form of an absolute url Returns the same url with all the necessary path information to be used offsite """ return request.build_absolute_uri(absoluteurl)