Downloading a file on the fly from Flask+sqlalchemy

Following code snippet shows how to implement downloading a file with flask. http://flask.pocoo.org/snippets/32/ def index(): strIO = StringIO.StringIO() strIO.write('Hello from Dan Jacob and Stephane Wirtel !') strIO.seek(0) return send_file(strIO, attachment_filename="testing.txt", as_attachment=True) In case you need to use the snippet to support downloading a file which is stored as BLOB originally and to convert it as a … Continue reading Downloading a file on the fly from Flask+sqlalchemy

Running Python Flask on a local IIS (not Azure!) with wfastcgi.py

There are already a lot of resources dealing with how to setup Django with IIS, or configure IIS to support WSGI with various tools such as Helicon Zoo, isapi-wsgi, and FastCGI. FastCGI looked good among others because I wanted to go with least 3rd party stack and the Microsoft distribute the wfastcgi.py through PTVS. However, there's a still one problem. I couldn't … Continue reading Running Python Flask on a local IIS (not Azure!) with wfastcgi.py