I’m reading a book ‘Python Crash Course 2nd edition’ and currently doing a Django project.
And in a form there are button with name=”submit” and and hidden input element with name=”next”.
In the book it says that the button with name=”submit” is a submit button and a hidden form element with name “next” is the value argument that tells Django where to redirect the user after they’ve logged in successfully.
I tried to search up button with name=”submit” and input hidden element with name=”next” in Django but wasn’t able to find any info.
How does it work? Are those somewhere predefined or no?
<form method="post" action="{% url 'users:login' %}">
{% csrf_token %}
{{ form.as_p }}
<button name="submit">Log in</button>
<input type="hidden" name="next" value="{% url 'learning_logs:index' %}" />
</form>
1