I am trying to search the student result using registration# ? Help appricated


from django.shortcuts import render

# Create your views here.
from django.shortcuts import render
from .forms import ResultForm
from .models import ResultQuery

def home(request):
    form=ResultForm(request.POST or None)
    template_name = "home.html"
    context = {"form": form}
    if form.is_valid():
        objects = ResultQuery.objects.filter(reg_number=form.cleaned_data['Reg_No'])
        context['objects'] = objects

    return render(request, template_name, context)


<h1>Search Your Result</h1>

<form method="POST" action=" "> {% csrf_token %}
    {{ form }}
    <input type="submit" value="Submit"/>


from django import forms

class ResultForm(forms.Form):

      Reg_No  =forms.CharField(label="Registration Number")

Your template isn’t rendering the objects from your query results.

Весь Ваш (код) = имитация логики = бутафория…!