librelist archives

« back to archive

Flask & Heroku

Flask & Heroku

From:
pronoyc@gmail.com
Date:
2012-06-19 @ 09:35
Hello.

I just noticed that Heroku keeps deleting my files and folders inside my
/static/img directories. I have created an app that uploads files to the
destination /static/img/uploadedmedia/randomdirectoryname

It is there for some time but after a while heroku deletes all of the files
and the directory itself (uploademedia). Now I don't understand has it got
anything to do with how flask is setup on Heroku or is it something to do
with Heroku itself. If anyone's experienced this problem before and might
have come across a solution, kindly share it with me.

Thanks

-- 
Regards,

Pronoy Chopra
http://blog.pronoy.in <http://www.pronoy.in/about>/
http://www.twitter.com/pronoyc

Re: [flask] Flask & Heroku

From:
Simon Sapin
Date:
2012-06-19 @ 10:07
Le 19/06/2012 11:35, pronoyc@gmail.com a écrit :
> Hello.
>
> I just noticed that Heroku keeps deleting my files and folders inside my
> /static/img directories. I have created an app that uploads files to the
> destination /static/img/uploadedmedia/randomdirectoryname
>
> It is there for some time but after a while heroku deletes all of the
> files and the directory itself (uploademedia). Now I don't understand
> has it got anything to do with how flask is setup on Heroku or is it
> something to do with Heroku itself. If anyone's experienced this problem
> before and might have come across a solution, kindly share it with me.
>
> Thanks

Hi,

This has nothing to do with Flask. The filesystem is considered 
read-only on Heroku, this allows them to deploy your app to different 
servers more easily.

You’ll need to store your uploaded files in a database or, well, 
somewhere. A quick search on their docs gives this:

https://devcenter.heroku.com/articles/read-only-filesystem
https://devcenter.heroku.com/articles/s3

Regards,
-- 
Simon Sapin