Answer the question
In order to leave comments, you need to log in
Why doesn't Flask streaming work on IIS?
I have code:
from flask import Flask, Response
from datetime import datetime
import time
app = Flask(__name__)
@app.route('/')
def first(): return 'ok'
@app.route('/stream')
def default():
def generate():
for i in range(0,10):
yield datetime.now().strftime('%H:%M:%S')
time.sleep(1)
return Response(generate(), mimetype='text/html') #Пробовал и mimetype='text/event-stream'
if __name__ == '__main__':
app.run(host='0.0.0.0', debug=True, port=5001)
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question