0

I am implementing a web app using Django/Python. To test the app, I need to click on the button so that the response will be sent to the back end and it is processed in views.py. Once it is processed the output response should be sent back to the front end and display on web page. I have explored every where but really didn't find anything that matches my requirement. I am new to Django and fighting on this issue for the last two days. Can anybody help me regarding this or share some direction on how to implement this. Any help would be appreciated. Thank you so much.

Button in my home.html

<input type="button" class="button" onclick="myFunction(value)" value="A" id = "sendtodjango" >

And my js script looks like this

<script>
function myFunction(value) {
//send value to views.py 

}
</script>

My intention is to send the value (which is a string) parameter to def process(): function in views.py and get it processed.

After processing the def process(): should send the updated string to my js script which is home.html (Once the string is retrieved it will be displayed to a textarea ()disabled)

Teja
  • 13,214
  • 36
  • 93
  • 155

0 Answers0