class CycleNode(template.Node):

    def __init__(self, cyclevars):
        self.cyclevars = template.Variable(cyclevars)

def render(self, context):
    names = self.cyclevars.resolve(context)
if self not in context.render_context:
    context.render_context[self] = itertools.cycle(names)
cycle_iter = context.render_context[self]
return next(cycle_iter)

@register.tag
def cycle_list(parser, token):
    pass
Unpack a list to cycle tag in django