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


Possibly Related Threads…
Thread Author Replies Views Last Post
  Can I develop a live video streaming application using python? mtrkhan 3 4,459 Nov-15-2021, 10:42 PM
Last Post: Larz60+
Question Deploy Flask apps on Windows... SpongeB0B 2 4,060 Aug-08-2021, 09:12 AM
Last Post: ndc85430
Question Flask, send_from_directory not working : solved SpongeB0B 2 7,473 Jan-26-2021, 07:02 AM
Last Post: SpongeB0B
  My flask website not working properly Aggam 2 2,163 Nov-03-2020, 09:53 AM
Last Post: Aggam
Photo Trying to set up virtualenv for windows not working zazas321 2 2,041 Oct-13-2020, 07:01 AM
Last Post: zazas321
  python 3.7 on windows using flask and flask-sqlalchemy. Alpy 2 4,013 Aug-12-2020, 07:24 PM
Last Post: Alpy
  Flask - IIS Get Windows User Name beachdogvet 0 4,977 Feb-28-2020, 12:37 PM
Last Post: beachdogvet
  Flask, Posgresql - Multiple requests are not working bmaganti 5 2,763 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,274 Feb-20-2019, 11:59 PM
Last Post: snippsat
  Failing to install Flask on Windows using pip shayon 1 2,889 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