python - How do i get output on html using django? -



python - How do i get output on html using django? -

i want "first click 1" click on "first click" button , "second click 2" click on "second click" button. here code. templates test.html

<html> <form action="get"> <input type="submit" value="first click" name="first"> <input type="submit" value="second click" name="second"> </form> <div> first click {{op0}} sec click {{op1}} </div> </html>

views.py is

def analytics(request): if(request.get.get('first')): homecoming render(request, 'test.html',{"op0":'1')}) elif(request.get.get('second')): homecoming render(request, 'test.html',{"op1":'2')})'

current output - when clicking on "first click" button getting "first click 1".

actual output - want "first click 1" "first click" button , "second click 2" "second click" created onclick event within submit button phone call method not working. in advance

python django

Comments

Popular posts from this blog

c - Compilation of a code: unkown type name string -

java - Bypassing "final local variable defined in an enclosing type" -

json - Hibernate and Jackson (java.lang.IllegalStateException: Cannot call sendError() after the response has been committed) -