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.
Just use jQuery ajax,it is easy to do
in django views.py
def fun1(request): user_input = request.GET.get('value') #put your code here return HttpResponse('what you want to output to web')
urls.py
url(r'^link-to-fun1$', views.fun1),
html
Your title
More see jQuery $.get method