ファイル オブジェクトのダウンロードを作成しようとしています。ファイルは django-filebrowser を使用して追加されました。つまり、ファイルへの文字列パスになります。私は次のことを試しました:
f = Obj.objects.get(id=obj_id)
myfile = FileObject(os.path.join(MEDIA_ROOT, f.Audio.path))
...
response = HttpResponse(myfile, content_type="audio/mpeg")
response['Content-Disposition'] = 'attachment; filename=myfile.mp3'
return response
ダウンロードされるファイルには、ファイルではなく、ファイルの場所へのパスの文字列が含まれています。ファイルオブジェクトにアクセスする方法について誰か助けてもらえますか?