ValueError in django project

**Hi all i am creating a student login page and gettting the error below, and to my surprise the same code for adminlogin works perfect. I am new to django so kindly clear my doubts to reduce this types of errors in future. Thanks in advance **

ValueError at /studentlogin/
The view myapp.views.studentlogin didn't return an HttpResponse object. It returned None instead.
Request Method: GET
Request URL:    http://localhost:8000/studentlogin/
Django Version: 5.0.4
Exception Type: ValueError
Exception Value:    
The view myapp.views.studentlogin didn't return an HttpResponse object. It returned None instead.
Exception Location: C:UsersHardip GajjarAppDataLocalProgramsPythonPython312Libsite-packagesdjangocorehandlersbase.py, line 332, in check_response
Raised during:  myapp.views.studentlogin
Python Executable:  C:UsersHardip GajjarAppDataLocalProgramsPythonPython312python.exe
Python Version: 3.12.2
Python Path:    
['E:\KantamEducation',
 'E:\KantamEducation',
 'C:\Program '
 'Files\JetBrains\PyCharm2023.3\plugins\python\helpers\pycharm_display',
 'C:\Users\Hardip '
 'Gajjar\AppData\Local\Programs\Python\Python312\python312.zip',
 'C:\Users\Hardip Gajjar\AppData\Local\Programs\Python\Python312\DLLs',
 'C:\Users\Hardip Gajjar\AppData\Local\Programs\Python\Python312\Lib',
 'C:\Users\Hardip Gajjar\AppData\Local\Programs\Python\Python312',
 'C:\Users\Hardip '
 'Gajjar\AppData\Local\Programs\Python\Python312\Lib\site-packages',
 'C:\Program '
 'Files\JetBrains\PyCharm2023.3\plugins\python\helpers\pycharm_matplotlib_backend']
Server time:    Tue, 23 Apr 2024 11:56:21 +0530

my views.py code is as under,

def studentlogin(request):
    if request.method == 'POST':
        try:
            user = Student.objects.get(
                email=request.POST['email'],
                password=request.POST['password']
            )
            request.session['email'] = user.email
            request.session['fname'] = user.fname
            return render(request, 'studentindex.html')
        except:
            msg = 'Invalid Email or Password'
            return render(request, 'studentlogin.html',{'msg':msg})

and my student login HTML form code is as under,

{% extends 'header.html' %}
{% load static %}
{% block content %}


 
<!-- Admin Login Page Start -->
 
  <section class="section admin" data-section="section6" >
    <div class="container">
      <div class="row">
        <div class="col-md-12">
          <div class="section-heading">
            <h2>Student Login</h2>
          </div>
        <div class="section-heading">
              {% if msg %}
                  <b style="font-size: 15px;color: antiquewhite;">{{msg}}</b>
              {% endif %}
          </div>
        </div>
        <div class="col-md-6">
          <form type="POST" method ="post" id="studentlogin" action="{% url 'studentlogin' %}">
              {% csrf_token %}    
            <div class="row">
              <div class="col-md-6">
                  <fieldset>
                      <input name="email" type="email" class="form-control" id="email" placeholder="Your Email" required="">
                  </fieldset>
                </div>
                <div class="col-md-6">
                  <fieldset>
                    <input name="password" type="password" class="form-control" id="password" placeholder="Enter Password" required="">
                  </fieldset>
                </div>
              <div class="col-md-12">
                <fieldset>
                  <button type="submit" id="form-submit" class="button">Login</button>
                </fieldset>
              </div>
            </div>
          </form>
        </div>
      </div>
    </div>
  </section>
<!--Admin Login Page Ends-->
    
{% endblock %}
</body>
</html>

**i am new to django. please help me. Thanks

while same code for admin account works fine, please go through the views.py code for admin as under,**

def adminlogin(request):
    if request.method == "POST":
        try:
            user = Creator.objects.get(
                email=request.POST['email'],
                password=request.POST['password']
            )
            request.session['email'] = user.email
            request.session['fname'] = user.fname
            return render(request, 'adminindex.html')
        except:
            msg = "Invalid Username And Password"
            return render(request, 'adminlogin.html', {'msg': msg})
    else:
        return render(request, 'adminlogin.html')

**thanks **

Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa Dịch vụ tổ chức sự kiện 5 sao Thông tin về chúng tôi Dịch vụ sinh nhật bé trai Dịch vụ sinh nhật bé gái Sự kiện trọn gói Các tiết mục giải trí Dịch vụ bổ trợ Tiệc cưới sang trọng Dịch vụ khai trương Tư vấn tổ chức sự kiện Hình ảnh sự kiện Cập nhật tin tức Liên hệ ngay Thuê chú hề chuyên nghiệp Tiệc tất niên cho công ty Trang trí tiệc cuối năm Tiệc tất niên độc đáo Sinh nhật bé Hải Đăng Sinh nhật đáng yêu bé Khánh Vân Sinh nhật sang trọng Bích Ngân Tiệc sinh nhật bé Thanh Trang Dịch vụ ông già Noel Xiếc thú vui nhộn Biểu diễn xiếc quay đĩa Dịch vụ tổ chức tiệc uy tín Khám phá dịch vụ của chúng tôi Tiệc sinh nhật cho bé trai Trang trí tiệc cho bé gái Gói sự kiện chuyên nghiệp Chương trình giải trí hấp dẫn Dịch vụ hỗ trợ sự kiện Trang trí tiệc cưới đẹp Khởi đầu thành công với khai trương Chuyên gia tư vấn sự kiện Xem ảnh các sự kiện đẹp Tin mới về sự kiện Kết nối với đội ngũ chuyên gia Chú hề vui nhộn cho tiệc sinh nhật Ý tưởng tiệc cuối năm Tất niên độc đáo Trang trí tiệc hiện đại Tổ chức sinh nhật cho Hải Đăng Sinh nhật độc quyền Khánh Vân Phong cách tiệc Bích Ngân Trang trí tiệc bé Thanh Trang Thuê dịch vụ ông già Noel chuyên nghiệp Xem xiếc khỉ đặc sắc Xiếc quay đĩa thú vị
Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa
Thiết kế website Thiết kế website Thiết kế website Cách kháng tài khoản quảng cáo Mua bán Fanpage Facebook Dịch vụ SEO Tổ chức sinh nhật