Python Forum
Flask Streaming not working on IIS Windows
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Flask Streaming not working on IIS Windows
#1
Need a help please:
I created an app to testing stream on Windows.
In development mode the streaming response working (get response in each second). But when deploy to IIS Windows and run in production mode then I receive the full body of response at end (streaming not working).
What I need to set in IIS to allow the streaming? Thanks
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/event-stream')

if __name__ == '__main__':
	app.run(host='0.0.0.0', debug=True, port=5001)
Reply


Messages In This Thread
Flask Streaming not working on IIS Windows - by Revencu - Nov-09-2019, 10:31 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Can I develop a live video streaming application using python? mtrkhan 3 4,378 Nov-15-2021, 10:42 PM
Last Post: Larz60+
Question Deploy Flask apps on Windows... SpongeB0B 2 3,986 Aug-08-2021, 09:12 AM
Last Post: ndc85430
Question Flask, send_from_directory not working : solved SpongeB0B 2 7,346 Jan-26-2021, 07:02 AM
Last Post: SpongeB0B
  My flask website not working properly Aggam 2 2,112 Nov-03-2020, 09:53 AM
Last Post: Aggam
Photo Trying to set up virtualenv for windows not working zazas321 2 1,999 Oct-13-2020, 07:01 AM
Last Post: zazas321
  python 3.7 on windows using flask and flask-sqlalchemy. Alpy 2 3,945 Aug-12-2020, 07:24 PM
Last Post: Alpy
  Flask - IIS Get Windows User Name beachdogvet 0 4,915 Feb-28-2020, 12:37 PM
Last Post: beachdogvet
  Flask, Posgresql - Multiple requests are not working bmaganti 5 2,672 Feb-20-2020, 03:02 PM
Last Post: bmaganti
  flask app to save images locally when deployed on heroku not working Prince_Bhatia 1 5,232 Feb-20-2019, 11:59 PM
Last Post: snippsat
  Failing to install Flask on Windows using pip shayon 1 2,858 Jul-11-2018, 12:36 AM
Last Post: micseydel

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020