@register.tag
def renderonce(parser, token):
    nodelist = parser.parse(('endrenderonce',))
    parser.delete_first_token()
    return RenderOnceNode(nodelist)

class RenderOnceNode(template.Node):
    def __init__(self, nodelist):
        self.nodelist = nodelist
    def render(self, context):
        k = type(self)
        if k not in context.render_context:
            context.render_context[k] = {}
        output = self.nodelist.render(context)
        if output in context.render_context[k]:
            output = ''
        else:
            context.render_context[k][output] = True
        return output