I have a template that contains a button.
I have a view for this template in a view file.
How can a part of the code be activated when this button is clicked - which is in the template?
How can you make this as easy as possible?
How can code be activated on click of a button in a Django view?
def click_button_summ(request):
context = {}
if request.POST.get("button_table_summ") == "button_table_summ":
///code///
return render(request, "click_button_summ.html", context)
<div class="ui container">
<div class="column">
<button type="submit" class="ui button" name="button_table_summ" value="button_table_summ">Button</button>
</div>
</div>`