Как изменить is_active в базе данных с помощью кнопки переключения на языке python

как я могу изменить is_active в базе данных с помощью кнопки переключения на языке python.

index.html
<table>
{% if user_detail.user.is_active %}
<td><label class="switch ">
<input type="checkbox" id="{{user_detail.user_id}}" value="{{user_detail.user.is_active}}" checked>
<span class="slider round">
</label>
</td>
{% else %}
<td><label class="switch">
<input type="checkbox" id="status1" value="{{user_detail.user.is_active}}">
<span class="slider round">
</span>
</label>
</td>
{% endif %}
</table>
Вернуться на верх