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

How can I configure django-quill-editor to save images in Amazon S3 and store Quill objects with the corresponding S3 URLs for the images? #120

Open
B-VAMSHIDHARREDDY opened this issue Jun 23, 2023 · 3 comments

Comments

@B-VAMSHIDHARREDDY
Copy link

QUILL_CONFIGS = {

"default": {
    "image_upload_url": "/questions/quill-image-upload/",
    "theme": "snow",
    "modules": {
        'history': {
            'delay': 2000,
            'maxStack': 500,
            'userOnly': True
        },
        "syntax": True,
        "toolbar": [
            [
                {"align": []},
                "bold",
                "italic",
                "underline",
            ],
            ["image"],
            ["clean"],
        ],
        # quill-image-compress
        "imageCompressor": {
            "quality": 0.8,
            "maxWidth": 1000,
            "maxHeight": 1000,
            "imageType": "image/jpeg",
            "keepImageTypes": [],
            "ignoreImageTypes": ["image/webp"],
            "debug": False,
            "suppressErrorLogging": True,
        },

        # quill-resize
        "resize": {
            "showSize": True,
            "locale": {},
        },
    },

},

}

This is my Quill config.

"image_upload_url": "/questions/quill-image-upload/",---- it is not working. Please help me

@sbryukov
Copy link

also interested for the solution

@llPekoll
Copy link

Django-Quill, will post the image in this format <img src="base64/........." />
i think you can make a parser to parse the result from the Quill input,

  • Get all the base64 image in the Quill input (QillField.conent).

  • Post the images to your s3 storage.

  • Get the values from the S3 storage.

  • and change the values of the base64 to the results of the s3 storage
    ex : <img scr="base64/........." /> ==> <img scr="https://s3.my-storage.eu3........." />

    hope it helps

@LeeHanYeong
Copy link
Owner

Currently, django-quill-editor encodes images as base64 and stores them in the DB.
(This allows you to use files without setting up static files, but it is inefficient.)

There is a way to use a separate storage in the milestone, but it is difficult to devote time to it at the moment. If you are dealing with large files that are difficult to store in the DB, you should use another editor that supports the file-upload function.

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

4 participants