LeeHanYeong / django-quill-editor

django-quill-editor makes Quill.js easy to use on Django Forms and admin sites
https://django-quill-editor.readthedocs.io
MIT License
202 stars 49 forks source link

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 1 year ago

B-VAMSHIDHARREDDY commented 1 year ago

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 commented 1 year ago

also interested for the solution

llPekoll commented 1 year ago

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,

LeeHanYeong commented 2 months ago

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.