i am developing a webpage with django, but i was wondering if there is a way to send two or more parametters in a view based on functions. Like this:
def index(request):
categoria = Clasificacion.objects.all()
contexto = {'categoria':categoria}
articulo = Articulo.objects.all()
contexto1 = {'articulo':articulo}
return render(request, 'home/index.html', contexto, contexto1)
As you can see, i am trying to send "contexto" and "contexto1" to the template, but it receives just one of them (just the "contexto").
This is the part of my urls.py for that function, if you need it:
url(r'^home', index, name='home'),
So, anyone can help me?.
Thanks a lot!.
Aucun commentaire:
Enregistrer un commentaire