Q:

What is the Django Form Action?

Many Django Forms examples does not include an action. Example,
<form method="post">
{% csrf_token %}
{{ form.as_p }}
<div class="form-actions">
    <button type="submit">Send</button>
</div>
</form>

Page source confirms that there is no form action. So what is the url for the form action upon submit which can be used for Jquery Ajax?
Thanks.

A:

If the action attribute of the form is not defined, the POST call is sent on the current URL on which the form was rendered. You can choose to change the URL on which the call needs to be sent and the method too.
You can change the URL by providing the action attribute to the form.
<form action="/my/url/">

To send the GET call to the current page or the URL specified in the action attribute by changing the method attribute of the form. The form fields will be sent as query parameters.
<form method="get" action="/my/url/">

