如何在其他功能仍在运行时访问其生成的列表
def index(request):
return render(request,"index.html")
def assigntoken(request):
#I got list of users from post request to assign token to each of them I call a class called AssignToken
v = AssignToken()
#AssignToken class has attribute called log_lst I want to be able to access this log_lst from result view while assigntoken view and class AssignToken still running
v.start(users) #this will start loop in users list to assign tokens
return redirect('/result')
def result(request):
#while assigntoken function still running I should be able to access /result to see live logs generated in v.log_lst (AssignToken class object), how to do this?, is it safe to make it global variable, will it be unique for each user access the webapp at same time?
context = {'logs':v.log_lst}
return render(request,"results.html",context)