Posts by @intersex (239)


My name is Jasper Camber Holton. I write, code, make music, and I am the developer of Uglek.com.

π

Hic usor administrator est.

Has 239 posts, follows 16 users and is followed by 11 users.

Last seen at January 22, 2022 19:24

Premium Member
@intersex's profile photo

Django Formulae Filtra ad HTTPS ac Highlight URLs addere His columellas templates Django uti potes, URLs HTTPS addere et eas velut ancoras textos elucidare (a) cum codice simplici. commentarios adjecimus ad describendas quomodo in codice opera omnia.

 # app/templatetags/app_filters.py 
ex urlextract import URLExtract 
 petitiones importas 
.... 
@register. filter(name='addhttpstodomains') # Prima sparguntur, ut HTTPS adde 
def addhttpstodomains(value): 
 ditiones = re.findall(r'+ domain[1] 
 repositum_items = [] 
 pro i, j in dic.items(): # Repone sine bis reponens 
 nisi i in replaced_items: [=NEWLINE= ] value = value.replace(i, j) 
 repositum_items.append(i); 
 valorem = str(value) 
 dum value.find('https://') > -1: # duplicata quaelibet 
 valorem = value.replace ('https://','https://') 
 valorem reddere 
 
@register.filter(name='embedlinks') 
def embedlinks(value): 
 output = "" 
 chunks = value.split("https://") # Split apud HTTPS 
 pro x, FRUSTUM in enumeratione (chunks): # Numerare per sectiones scissuras 
 si x != 0: 
 FRUSTUM = "https://" + FRUSTUM # HTTPS addere tergum in 
 URLs = extractor.find_urls(chunk); # Invenire URL in FRUSTUM 
 dic = {} 
 pro URL in urls: 
 plus = '(in Uglek)' # Configurare anchoram tag 
 si non url[8:17].infer() == 'uglek.com': 
 plus = ' (te extra Uglek)' 
 si url.endswith('. ') vel url.endswith(','): 
 url = url[:-1] 
 nisi url.lower().startswith('uglek.com') et url.lower().startswith('https://'): 
 tenta: 
 responsio = petitiones.' + url[8:] + ' ' # Anchoram tag reponere URL cum 
 nisi: 
 print("URL non est") 
 elif url.startswith(' https://'): 
 dic[url] = ' ' + url[8:] + ' ' 
 pro i, j in dic.items(): # Find ac reponere in FRUSTUM 
 FRUSTUM = chunk.replace(i, j) 
 output = output + FRUSTUM # Remitte fragmenta simul 
 redi output
In actione, hae tags vultus amo:
{{ post.content|addhttpstodomains|embedlinks }} # HTTPS addere et nexus iuncti 


© Uglek, 2022

Terms of Use et Privacy policy