I added custom button into my app_index.html file:
<form action="{% url 'admin:index' %}">
<input type="submit" value="{% trans 'Another Button' %}"
name="_anotherbutton" />
</form>
I have simple function:
def printer():
print('Some text')
How can I run this function using my custom button? Now it maps to admin:index but I would like it to run printer function and go to another view (or show alert message using jquery - I will think about it). Printer function is just an example - in real it will do some database search/modify database and go to result view.