Heroku上的媒体文件 [英] Media files on Heroku

查看:83
本文介绍了Heroku上的媒体文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果我在Heroku上托管了一个小型Django网站,而我仅使用一个dyno,是否可以保存该服务器上的媒体文件,还是我必须使用AWS S3存储来存储媒体文件?媒体存储还有哪些其他选择?

If I host a small Django website on Heroku and I am using just one dyno, is it save to upload media files on that server, or should I necessarily use AWS S3 storage to store media files? What are other alternatives for media storage?

推荐答案

否,将内容存储在Heroku文件系统上永远都不安全.即使您只有一个dyno,它仍然是短暂的,可以随时被杀死.例如当您推送新代码时.

No, it is never safe to store things on the Heroku filesystem. Even though you only have one dyno, it is still ephemeral, and can be killed at any time; for example when you push new code.

这篇关于Heroku上的媒体文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆