Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
azataiot opened this issue Jul 7, 2022 · 5 comments
Closed

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

azataiot opened this issue Jul 7, 2022 · 5 comments

Comments

@azataiot
Copy link

azataiot commented Jul 7, 2022

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

@pylixm
Copy link
Owner

pylixm commented Jul 7, 2022 via email

@azataiot
Copy link
Author

azataiot commented Jul 8, 2022

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

@azataiot
Copy link
Author

azataiot commented Jul 8, 2022

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

@azataiot azataiot closed this as completed Jul 8, 2022
@Sqvall
Copy link

Sqvall commented Sep 10, 2022

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.

@azataiot
Copy link
Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants