My code is below
template looks like this
<td><button><a href="{% url 'testschema' allschema.schema_name %}"> Test</a></button></td>
<td><button><a href="{% url 'deleteschema' allschema.schema_name %}"> Delete</a></button></td>
url patterns
urlpatterns = [
path('<int:id>/', views.confighome, name='config'),
path('<str:schmid>/', views.deleteschema, name='deleteschema'),
path('te<str:schmid>/', views.testschema, name='testschema')
]
views.py
def deleteschema(request,schmid):
some code
return redirect('/configuration/'+str(request.session["project_id"]))
def testschema(request,schmid):
some code
return redirect('/configuration/'+str(request.session["project_id"]))
Whenever I click on the Testbutton its actually calling the delete function
Any idea why this happening Since I used named url parameters
Thanks in advance
teis a string.