def render(self, name, value, attrs=None):
        content = super().render(name, value, attrs=None)
        soup = BeautifulSoup(content)

        # Show useful link/relationship in admin
        a_href = soup.find('a')
        if a_href and a_href.attrs['href']:
            a_href.attrs['href'] = a_href.attrs['href'].replace(settings.MEDIA_ROOT, settings.MEDIA_URL)
            a_href.string = a_href.text.replace(settings.MEDIA_ROOT, settings.MEDIA_URL)

            if '//' in a_href.attrs['href']:
                a_href.attrs['href'] = a_href.attrs['href'].replace('//', '/')
                a_href.string = a_href.text.replace('//', '/')

        return mark_safe(soup)
Fix admin rendering
dataset/ETHPy150Open python/pythondotorg/pages/admin.py/PageAdminImageFileWidget.render