I have the following django formset represented in the template:
<form method="post" action="">
{% csrf_token %}
{{ formset.management_form }}
{% csrf_token %}
<table width="100%" border="0" cellspacing="0" cellpadding="0">
{% for form in formset %}
{% csrf_token %}
<tr>
<th>My Activities</th>
<th>Duration</th>
<th>Log</th>
</tr>
<tr>
<td>{{ form.instance.activity.name }}</td>
<td><input type="text" class="minutesinput"> Minutes</td>
<td>
<div class="actvty_log_entry">
<input type="submit" value="Log Entry">
</div>
</td>
</tr>
{% endfor %}
</table>
</form>
When I submit the form, I get the error:
Forbidden (403)
CSRF verification failed. Request aborted.
Note: my normal forms work in all my other views and the middleware is activated
The problem was I was using render to response instead of:
return render(request, 'customers/password-change.html', context)
Changing to the above worked. Thanks for the hint @Daniel Roseman