How about trying something like that?
from collections import namedtuple Link = namedtuple('Link', ['title', 'url'], verbose=True) def Save(request): ... for i in reversed(nba): links.append(Link(title=i.text, url=i["href"])) # list of urls ... Then template would be:
{% for link in links %} <a href="{{link.url}}">{{link.title}}</a> {% endfor %} And if you want to stick with two lists, then you should have a glance at this questionthis question.