1π
β
In your <form>
you are confusing the method="β¦"
with the action="β¦"
attribute. The method="β¦"
specifies the HTTP request type, whereas the action="β¦"
specifies to what endpoint the request will be submitted.
You thus should work with:
<form method="get" action="{% url 'add' %}">
<input type="text" name="num1" placeholder="Enter first number"><be>
<input type="text" name="num2" placeholder="enter second number"><be>
<input type="submit">
</form>
The method="get"
is not necessary, since by default a form will be submitted through a GET request.
Source:stackexchange.com