[Fixed]-Django- How to filter the database based on the submitted form data

1👍

In place of

return redirect('result')

Use

return render(request,self.template_name,{'score':scor})

And to render in html.

<div class="">   <!--result shown on the right part-->
<table border="0" cellspacing="10" cellpadding="10">        
{% for list in score %}
    <td bgcolor="#F0F0F0"> {{list.subject}}</td>  
    <td bgcolor="#F0F0F0"> {{list.scor}}</td>
    .................       
{% endfor %}
</table>
</div>

Leave a comment