gpt4 book ai didi

django - django-filebrowser 和 django-storages 的 bug 哪个库有问题?

转载 作者:行者123 更新时间:2023-12-03 03:30:59 25 4
gpt4 key购买 nike

我使用 django-filebrowser 和 django-storages(带 s3boto)将文件嵌入添加到我的 django 项目的tinyMCE 实现中。

最近我注意到有一个错误,当使用 S3 作为后端时,django-fileborwser 无法正确保存上传文件的缩略图版本。

我逐步完成了版本创建功能(在 django-filebrowser 中),并发现了我认为的错误。

fp is at EOF. Use rewind option or seek() to data start.

这是因为

# Rewing the file pointer back to 0, before saving to the storage object
tmpfile.seek(0)

之前没有调用过

# Existing Code
site.storage.save(version_path, tmpfile)

我通过问题跟踪器报告了该错误以及我建议的修复。然后,该存储库的作者让我大吃一惊并问道:

@fyaconiello shouldn´t that snippet be part of the s3-storage engine (with django-storages) instaed of adding it to the filebrowser?

  1. 我猜想文件倒带可以在任一库中完成。但它属于哪个图书馆呢?
    • django-storages 应该确保所有 tmpfile 指针都回滚吗?
    • 这是 django-filebrowser 的工作吗?因为它是 implimentor?

See my full issue here

最佳答案

他们在这里提供了一个解决方案:https://github.com/sehmaschine/django-filebrowser/issues/40

关于django - django-filebrowser 和 django-storages 的 bug 哪个库有问题?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12249458/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com