I hope you can help me, I'm trying to make a function in which passing the parameter can render different template but I do not know what is wrong if the views or the url, someone helps me?
views.
def hola(request, par):
#val = val
pregunta = Datos_usuario_DB.objects.all().order_by('-id').filter(activo="1")[:15]
respuesta = Datos_respuesta_DB.objects.all().order_by('-id')[:15]
preguntarespuesta = zip(pregunta, respuesta)
#pregunta2 = [{'nombre':'hh'},{'nombre':'hhsss'}]
plantilla = {'': 'index.html', 'nosotros': 'nosotros.html', 'contacto': 'contacto.html'}
return render(request, plantilla['%s' % par], {'preguntarespuesta': preguntarespuesta})
#return HttpResponse(val)
urls
url(r'^[a-z\.-]+$', views.hola, name='hola'),