How don't change '/media/' on heroku after "git push ..."

150 Views Asked by At

Help me please. I have django app on Heroku. I want that after $ git push heroku master folder /media/ on Heroku don't change. Thank you.

1

There are 1 best solutions below

1
On BEST ANSWER

/media is for user-uploaded files. These must not be stored in the Heroku filesystem.

Heroku creates a new dyno each time you deploy your code, as well as whenever you run a management command and at irregular times otherwise. Each new dyno has its own filesystem which is not shared with other ones and only contains the files from your git repo.

You must configure Django to upload media files somewhere permanent, such as S3.