I'm using Django 0.91
More or less, this is what I'm doing:
appname/templatetags/app_extras.py:
from django.core.template import Library, Node
register = Library()
class MyNode(Node):
def __init__(self, foo):
self.foo = foo
print 'foo' * 100
def render(self, context):
print 'bar' * 100
return 'bar' * 100
@register.tag
def mytag(parser, token):
return MyNode(0)
In my template:
{% load app_extras %}
{% mytag %}
When I run this using the development server, 'foo' * 100 is printed,
but 'bar' * 100 is not. That is, it looks like render is never being
called? Is there anything obviously wrong with what I'm doing?
On another note, I tried stepping through the code with pdb, but it
was ignoring my breakpoints. I tried running the server with --
noreload too, but 0.91 doesn't seem to support that.
Any advice would be greatly appreciated, thanks.
Kevin