Page not found after inserting data



    <form action="{% url 'insert' %}" method="POST">

        {% csrf_token %}



from django.urls import path, include

from .import views

urlpatterns = [

path("", views.InsertPageView, name=“insertpage”),

path(“insert/”, views.InsertData, name=“insert”),

from django.shortcuts import render

from .models import *

Create your views here.

def InsertPageView(request):

return render(request,"app/insert.html")

#Inserting data into database

def InsertData(request):

#data come from html to view

fname = request.POST['fname']

lname = request.POST['lname']

email = request.POST['email']

contact = request.POST['contact']

#creating object of model Class

#inserting data into table

#object_name = Class.object.create(Model's_vname = view's_vname)

newuser = Student.objects.create(Firstname=fname, Lastname = lname, 

                                Email = email, Contact = contact)

#after insert render render on show.html

return render(request,"app/show.html")

error :
Using the URLconf defined in project.urls, Django tried these URL patterns, in this order:

  1. admin/
  2. [name=‘insertpage’]
  3. insert/ [name=‘insert’]

The current path, { % url 'insert' %}, didn’t match any of these.

please help with solutions. thank you