1 2 3 4 5 6 7 8 9 10 11 12 | 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 <absoluteurl>
Returns the same url with all the necessary path information to be used offsite
"""
return request.build_absolute_uri(absoluteurl)
|
More like this
- Absolute URL Templatetag by johnboxall 4 years ago
- Add site info to request context by bthomas 4 years, 6 months ago
- ScriptPrefixMiddleware by shellsage 3 years, 8 months ago
- getattr template filter by joshua 6 years, 2 months ago
- Template-Filter for Feedparser-Dates by kioopi 3 years, 11 months ago
Comments