Dimitris Kougioumtzis Blog About technology

Template tag to get url

Category Django

Posted on July 31, 2017



Template tag to get url


 1
 2
 3
 4
 5
 6
 7
 8
 9
10
from django import template
from django.urls import reverse_lazy

register = template.Library()


@register.filter(name='geturl')
def geturl(value):
    """Return the url from a string value"""
    return reverse_lazy(value)

About

My name is Dimitris Kougioumtzis and i work as a Web developer at Rapidbounce Company

Elsewhere