first of all, I want to dynamically refresh the part of the page by clicking a button to send the data to the background, and then the back end returns the data to the page to complete the rendering.
data passed by the front end
test2: function (currentRow){
let transPara = currentRow
axios({
method: "post",
url: "/management/",
data: Qs.stringify(transPara)
})
}
I verified that there is no problem in this part. The backend can receive the sent data.
def management(request):
if request.method == "GET":
graph_all = Graph.objects.all()
list1 = [i.name for i in graph_all]
data = [{"name":i} for i in list1]
context = {"data":data}
return render(request, "management.html",context=context)
if request.method == "POST":
print(request.POST)
return render(request, "management.html",{"pre":"ssss"})
the data received by the backend is as follows, but after post, the pre is not received by the front end and cannot be rendered