I\'d like to execute some Python code if that button is pressed on web.The thing is, I need the page not to redirect or refresh or anything.
You may want to try the Ajax library for Django project:
http://www.dajaxproject.com/
In case you've never heard of Ajax, here's the definition from Wikipedia:
Ajax (an acronym for asynchronous JavaScript and XML) is a group of interrelated web development techniques used on the client-side to create asynchronous web applications.
With Ajax, web applications can send data to, and retrieve data from, a server asynchronously (in the background) without interfering with the display and behavior of the existing page.