Using Heroku for Django Media Files

后端 未结 2 1770
忘了有多久
忘了有多久 2020-11-29 10:16

On the heroku domain, I am not able to load my Media(Images Saved by using ImageField property) file images. However, I am able to see the images saved in the static field i

2条回答
  •  死守一世寂寞
    2020-11-29 11:20

    The Heroku filesystem is ephemeral, so dynos boot with a clean copy of the filesystem from the most recent deploy. Here are some ways to work around this:

    1. AWS S3
    2. If you don't want to set up an account with AWS to create an S3 bucket, Heroku has add-ons that handle storage and processing of static assets

    For more details on this issue, see https://help.heroku.com/K1PPS2WM/why-are-my-file-uploads-missing-deleted

提交回复
热议问题