How to create a downloadable csv file on GAE using KAY Framework?

37 views
Skip to first unread message

Aki Tanaka

unread,
Jun 12, 2013, 9:09:41 PM6/12/13
to kay-...@googlegroups.com
Hi,

I would like to create a downloadable csv file which allow user to click on the link to download it.
I found a related question on stackoverflow http://stackoverflow.com/questions/2767910/google-app-engine-python-download-file
But it uses webapp framework.

Can anybody help me?
Thanks

Paolo Casciello

unread,
Jun 14, 2013, 6:14:58 AM6/14/13
to kay-...@googlegroups.com
Hi Aki,

Kay uses the Werkzeug's Response class (here for reference: http://werkzeug.pocoo.org/docs/wrappers/#werkzeug.wrappers.BaseResponse )

So the response object has a .headers attribute which is of Headers type: http://werkzeug.pocoo.org/docs/datastructures/#werkzeug.datastructures.Headers

you can add the headers via response.headers.add('Content-type', 'text/csv')
and so on.. 

Hope this helps!

Bye,
 Paolo
Reply all
Reply to author
Forward
0 new messages