Ram
Ram

Reputation: 4779

Failed to fetch content for the given url - Django CKEditor on Heroku

I am using Django-CKEditor as a rich text editor for one of my applications.

The problem is with the Media Embed plugin on Heroku.

When I insert any URL in the Media Embed option it works fine in my local environment. But when I insert URL in my deployed application (on Heroku), It shows me a - "Failed to fetch content for the given url." error.

Does anybody know why is this happening ?

This are my CKEDITOR Configurations in settings.py file.

CKEDITOR_CONFIGS = {
    'default': {
        'toolbar': 'Custom',
        'width': 'auto',
        'toolbar_Custom': [
            ["Format", "Bold", "Italic", "Underline", "Strike", "SpellChecker"],
            ['NumberedList', 'BulletedList', "Indent", "Outdent", 'JustifyLeft', 'JustifyCenter',
             'JustifyRight', 'JustifyBlock'],
            ["Image", "Table", "Link", "Unlink", "Anchor",
                "SectionLink", "Embed"], ['Undo', 'Redo'], ["CodeSnippet"],
            ["Maximize"]
        ],

        # Remove these dialog tabs (semicolon separated dialog:tab)
        'removeDialogTabs': ';'.join([
            'image:advanced',
            'image:Link',
            'link:upload',
            'table:advanced',
            #'tableProperties:advanced',
            ]),
        
        # Extra plugins to be used in the editor
        'extraPlugins': ','.join([
            'mathjax',  # Used to render mathematical formulae
            'codesnippet',  # Used to add code snippets
            'image2',  # Loads new and better image dialog
            'embed',  # Used for embedding media (YouTube/Slideshare etc)
            'tableresize',  # Used to allow resizing of columns in tables
        ]),
    }

}

Upvotes: 0

Views: 744

Answers (2)

fulgencio cruz
fulgencio cruz

Reputation: 1

now you have to create a account in iframely.com and send de api key in the request in config.js

Upvotes: -1

Philli
Philli

Reputation: 1

ckeditor changed the default for embed_provider from //ckeditor.iframe.ly/api/oembed?url={url}&callback={callback} to '' adding the the setting with previous default to your config should fix the issue.

more info here https://ckeditor.com/docs/ckeditor4/latest/api/CKEDITOR_config.html#cfg-embed_provider

Upvotes: 0

Related Questions