[英]Django:How to store images in database instead of media file?
I want to store images in database for various users.Its just like famous blog app but instead of blogs i want to store images in database.How can i implement my idea?我想将图像存储在数据库中以供各种用户使用。它就像著名的博客应用程序,但我想将图像存储在数据库中而不是博客。我该如何实现我的想法?
You can do one thing -> change the image into base64 string and save it to database than when you want that image convert it from base64 to normal format.您可以做一件事-> 将图像更改为 base64 字符串并将其保存到数据库,而不是将其从 base64 转换为正常格式。 and you can find multiple tutorial on internet how to change image to base64 in python.您可以在互联网上找到多个教程如何在 python 中将图像更改为 base64。 why i am suggesting this because i used it in an android app.为什么我建议这样做,因为我在 android 应用程序中使用了它。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.