bootstrap popover with form in data-content working in Django 1.11 and 2.0 but not in Django 2.1-3.1

I have code below and it is working as it should in django 1.11 and after upgrading it works in django 2.0 but for some reason it is not working in higher versions of django starting from 2.1 till 3.1.4.
Popover button:

<button
type=“button”
class=“btn btn-sm btn-secondary”
id=“dodaj-poziv-za-clanove-tijela”
data-container=“body”
data-toggle=“popover”
title=“Da li želite da dodate članove tijela u sastanak ?”
data-content=
"<form method='POST' action='{% url 'poziv_clanovi_dodaj' poziv_id=poziv.id %}'>
<button type='submit' class='btn btn-success btn-sm clanovi float-right'>Dodaj</button>
{% csrf_token %}
</form>
"
> Dodaj poziv za članove tijela

In browser this button looks normal for working django versions 1.11 and 2.0 but in those that are not witch is every version above 2.0 including 2.1,2.2 and 3.0,3.1 it button has "> in it and after submitting i get csrf token error

If you think the problem lies in Django, you might try to bisect the commit causing this “regression”.

In this case I ’ ve found a solution I replaced {% csrf_token %} with syntax like:
<input type='hidden' name='csrfmiddlewaretoken' value='{{ csrf_token }}'>
but I still don’t know why {% csrf_token %} in that example works in django 1.11 - 2.0.13 but doesn’t in latest versions starting 2.1 - 3.1.4

I had to do some editing, code wasn’t showing right