def getNode(template, context=Context(), name='subject'):
 for node in template:
  if (isinstance(node, BlockNode) and (node.name == name)):
   return node.render(context)
  elif isinstance(node, ExtendsNode):
   return getNode(node.nodelist, context, name)
 raise Exception(("Node '%s' could not be found in template." % name))

def getNode ( template , context = Context ( ) , name = 'subject' ) : for node in template : if ( isinstance ( node , BlockNode ) and ( node . name == name ) ) : return node . render ( context ) elif isinstance ( node , ExtendsNode ) : return getNode ( node . nodelist , context , name ) raise Exception ( ( "Node '%s' could not be found in template." % name ) )
get django block contents from a template .