![](/img/trans.png)
[英]I'm trying to plot a pie chart using data from a CSV file but I'm getting an error I don't understand
[英]I'm Trying to create a flask app that download a file from internet on heroku. But i don't know where file is getting stored
這是代碼。 它適用於本地主機並下載保存 app.py 的文件。
import requests
app = Flask(__name__)
@app.route('/')
def hello():
return '<h1>Hello World!</h1>'
@app.route('/download')
def download():
download_url = "https://www.python.org/static/community_logos/python-logo-master-v3-TM.png"
r = requests.get(download_url)
with open("python_logo.png",'wb') as f:
f.write(r.content)
return "<h2>Download Complete<h2>"
if __name__ == "__main__":
app.run()
我不想使用 S3 上傳文件,因為文件大小為 2-3 MB,我不想花在 S3 上。
如果您上傳的文件大小為 2-3 MB,則無需在 S3 上花費任何費用。 AWS S3 免費提供 5 GB 的標准存儲,它是安全、耐用和可擴展的 object 存儲基礎設施。 您可以發出 20,000 個 Get 請求和 2,000 個 Put 請求。 不建議將上傳的對象存儲在web服務器的磁盤上。 AWS 為免費套餐提供了相當不錯的存儲空間。 如果您要超過這些限制,您無論如何都必須考慮超越免費雲存儲層。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.