在数据库Django的店面形象 [英] django store image in database

查看:190
本文介绍了在数据库Django的店面形象的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有谁知道,如果有直接在数据库中存储的图像与使用ImageField的是简单地把它上传到MEDIA_ROOT模型类型的超出框的方式。
如果有,一个人如何成为这些图片呢?

Does anyone know if there's an out-of-the box way of storing images directly in the database vs. using ImageField model type that simply uploads it to the MEDIA_ROOT. And if there is, how does one serve those images then?

干杯

推荐答案

没有,没有。有很好的理由。它的效率极其低下的存储和从数据库提供图片。它们存储在文件系统中,并直接从Apache的为他们服务。

No, there isn't. And for good reason. It's horribly inefficient to store and serve images from the database. Store them on the filesystem, and serve them directly from Apache.

这篇关于在数据库Django的店面形象的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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