*As I see I need this:* * stream = cStringIO.StringIO() * * return stream.getvalue() * * * *I have a ready to go content as a string in a variable:* *content = * '.....'* *
So how to put this string in a stream? *My code is:* * * * def download(): response.headers['Content-Type'] = 'text/csv' attachment = 'attachment;filename=' + file+ '.csv' response.headers['Content-Disposition'] = attachment content = '....,....,....' raise HTTP(200,str(content), **{'Content-Type':'text/csv', 'Content-Disposition':attachment + ';'})* * *