I have this simple function in my Flask
app.
@app.route('/download')
@login_required
def download():
url="some_random_video_url_here"
re = requests.get(url)
with open("download/hello.mp4", 'wb') as file: #save hello.mp4 to download folder
file.write(re.content)
file.close()
flash("done downloading.")
return render_template('download.html')
When I run the app locally, the download function just run fine. But when I deploy the code to Heroku
and access the url, I get 500 Internal Server Error
I think it has something to do with file system on Heroku
but I don't know how to make this work. So how?