Djangoで次のビューを使用してファイルを作成し、ブラウザにダウンロードさせています
def aux_pizarra(request):
myfile = StringIO.StringIO()
myfile.write("hello")
response = HttpResponse(FileWrapper(myfile), content_type='text/plain')
response['Content-Disposition'] = 'attachment; filename=prueba.txt'
return response
しかし、ダウンロードされたファイルは常に空白です。
何か案は?ありがとう