def absurl(fragment):
 root = settings.MEDIA_URL
 root += (((root[(-1):] != '/') and '/') or '')
 return urlparse.urljoin(root, fragment)

def absurl ( fragment ) : root = settings . MEDIA_URL root += ( ( ( root [ ( - 1 ) : ] != '/' ) and '/' ) or '' ) return urlparse . urljoin ( root , fragment )
create an absolute url based on media_url .