django-quill-editor icon indicating copy to clipboard operation
django-quill-editor copied to clipboard

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?

Open B-VAMSHIDHARREDDY opened this issue 1 year ago • 3 comments

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

B-VAMSHIDHARREDDY avatar Jun 23 '23 07:06 B-VAMSHIDHARREDDY

also interested for the solution

sbryukov avatar Jul 18 '23 18:07 sbryukov

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

llPekoll avatar Sep 15 '23 13:09 llPekoll