how to create custom template tag in django code example
Example 1: how to connect templates in django
# Template directory setting
TEMPLATE_DIRS = (
os.path.join(os.path.dirname(__file__), 'templates'),
)
Example 2: template tags in django
from django import template
register = template.Library()
#simle Tag
@register.simple_tag
def fun_name(data):
return data