[Answer]-Django – can't add new value to view context

1👍

You could add a new key/value pair to your dictionary like this:

k['new']='newcontent'

Hope this helps.

👤Jingo

0👍

def view(request):  
    lista_baza = Usluga.objects.all()
    k= {
        'lista_uslug': lista_baza
    }


    k['new'] = 'your context'

    return render(request, 'main.html', k)
👤zabusa

Leave a comment