django - Custom Template tags only evaluate when put inside another block -


i have custom tag classytag

class getlanguage(tag):     name = 'getlanguage'     options = options(         argument('name', resolve=false)     )      def render_tag(self, context, name):         raise  #i put raise here see if run code?         return name  register.tag(getlanguage) 

and base.html template

{% block myblock %}{% endblock %} blah blah 

and index.html template

{% extend base.html %} {% block myblock %}{% endblock %} 

if put tag in index.html (not in block)

{% getlanguage %} {% block myblock %}{% endblock %} 

nothing happend. if put in base.html it's work. if move code in block in index.html it's work.

{% block myblock %}{% getlanguage %}{% endblock %} 

why?


Comments