Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

Sending POST request in Django

templates/third.html
<form action="/blog/hello" method="POST">
    {% csrf_token %}
    <input name="v" /> 
<input type="submit" value="submit"/>

views.py

def third(request):
    
   if request.method=="POST":
         return render(request,'third.html', {'name': request.POST['v']})
   else:
       return HttpResponse("HELLO WORLD IS TRUE")
 
PREVIOUS NEXT
Tagged: #Sending #POST #request #Django
ADD COMMENT
Topic
Name
8+5 =