Django: Passing value from template to view
问题 I HAD this situation: Clicking on a html submit button, I call views.stream_response which "activates" views.stream_response_generator which "activates" stream.py and return a StreamingHttpResponse and I see a progressive number every second up to m at /stream_response/ : 1 2 3 4 5 6 7 8 //e.g. my default max value for m stream.py from django.template import Context, Template import time def streamx(m): lista = [] x=0 while len(lista) < m: x = x + 1 time.sleep(1) lista.append(x) yield "<div>