creating a custom template tags in django
creating a custom template tags in django I am new to Django and I am trying to create custom tags in django my custom tag file templatetag/custom_tag.py templatetag/custom_tag.py from django import template from model_file.models import my_Model register = template.Library() @register.simple_tag def get_custom_tag_fn(): return my_Model.objects.all() my html file {% load custom_tag %} {% get_custom_tag_fn as queries %} {% for query in queries %} {{query.json_my_model_data}} {% endfor %} I am not getting any output or error from this code. Can anyone point where I went wrong. for extra information my model.py looks like model.py from django.db import models from jsonfield import JSONField class my_Model(models.Model): json_my_model_data = JSONField() Are there any instances in my_Model ? – Willem Van Onsem Jul 1 at 9:43 ...