简体   繁体   English

我无法在 Django Admin 中导出 CSV 文件中的图像

[英]I am not able to export image in CSV file in Django Admin

Everytime I export the data all of it gets exported but for the image which is there I am only getting the url of the image and not actual image.每次我导出数据时,所有数据都会被导出,但对于那里的图像,我只得到图像的 url 而不是实际图像。 Image of exported CSV file导出的 CSV 文件的图像

Database fields from where I export it我导出它的数据库字段

I want the actual image to be exported in CSV file and not the image storage path.我希望以 CSV 文件而不是图像存储路径导出实际图像。 If anyone knows how to do it kindly help.如果有人知道该怎么做,请提供帮助。

You cannot save files in the database and you can only save the address where they are stored.您不能将文件保存在数据库中,您只能保存它们存储的地址。 But there is one way, and that is to convert the files to a base64 format and save them as a string or text.但是有一种方法,那就是将文件转换为 base64 格式并将它们保存为字符串或文本。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM