pylixm / django-mdeditor

Django-mdeditor is Markdown Editor plugin application for django base on Editor.md.
https://pypi.org/project/django-mdeditor/
GNU General Public License v3.0
481 stars 103 forks source link

如何将图片上传到S3? #167

Closed azataiot closed 2 years ago

azataiot commented 2 years ago

我现在的项目使用 django-storage 将static 文件都放到了s3 上面, 但是发现django-mdeditor 并不会将图片上传到s3

pylixm commented 2 years ago

这是来自QQ邮箱的假期自动回复邮件。您好,我最近正在休假中,无法亲自回复您的邮件。我将在假期结束后,尽快给您回复。

azataiot commented 2 years ago

感谢回复,祝你假期愉快!我创建了一个新的fork,准备去实现一下这个功能。

azataiot commented 2 years ago

如果需要改功能可以参考我提交的PR [#168 ](#168)

Sqvall commented 1 year ago

Hello.

Sorry, but why we trying manual management this process, if django has special api default_storage for this.

If we will use it for file uploading we can:

Im prepare PR #173 For you could check it out.

Or correct me if I'm wrong in my hypothesis.

azataiot commented 1 year ago

Hello.

Sorry, but why we trying manual management this process, if django has special api default_storage for this.

If we will use it for file uploading we can:

  • Remove config parameters like upload_to_S3 and s3_check_existence, because uploader will inherit common behavior from settings.py.
  • Brake dependencies from concrete implementation storage.
  • Improve integration with django-storage because use default_storage we automatically inherit correct processing for settings like DEFAULT_FILE_STORAGE https://django-storages.readthedocs.io/en/latest/backends/amazon-S3.html

Im prepare PR #173 For you could check it out.

Or correct me if I'm wrong in my hypothesis.

I believe this is more general and beautiful solution, yet I am still checking whether it works with some special cases.