1

While redirecting to index.html, I pass the topics variable in the argument:

def index(request):
    args={
        'user': request.user,
        'topics': Topic.objects.all(),
    }

    return render(request, 'index/index.html', args)

Now in the template, I want to get the second topic from the list. Tried doing like

{{topics.get(1)}}

or

{{topics}}.get(1)

What is the correct way to do it?

Jieke Wei
  • 173
  • 2
  • 13

0 Answers0