вернуть DataFrame как колбу CSV

return Response(
       df.to_csv(),
       mimetype="text/csv",
       headers={"Content-disposition":
       "attachment; filename=filename.csv"})
Gifted Gull