Skip to main content

feincms-oembed converts standard URLs from more than 200 content providers into embedded videos, images and rich article previews by letting Embedly or another OEmbed provider to the hard work.

It’s stunningly simple to use:

  1. Add 'feincms_oembed' to INSTALLED_APPS.

  2. Create the content type:

    from feincms.module.page.models import Page
    from feincms_oembed.contents import OembedContent
    
    TYPE_CHOICES = [
        ('default', _('Default presentation'), {
            'maxwidth': 500, 'maxheight': 300, 'wmode': 'opaque'}),
        ('transparent', _('Transparent'), {
            'maxwidth': 500, 'maxheight': 300, 'wmode': 'transparent'}),
        ]
    
    Page.create_content_type(OembedContent, TYPE_CHOICES=TYPE_CHOICES)

You can also specify additional parameters which are sent to the OEmbed provider too:

Page.create_content_type(OembedContent, TYPE_CHOICES=TYPE_CHOICES,
    PARAMS={'wmode': 'opaque'})

By default feincms_oembed uses the Embedly Oembed Provider. This provider requires an API key even for the free plan. settings.EMBEDLY_KEY must therefore be set. The free plan is good for 5000 URLs per month.

If you want to customize the Embedly request or use another OEmbed provider, set settings.OEMBED_PROVIDER to a function receiving the URL and a dict with additional arguments and returning a suitable URL which returns OEmbed JSON on access. OEMBED_PROVIDER must either be a dotted python path or a callable:

from feincms_oembed.providers import embedly_oembed_provider
def my_provider(url, kwargs):
    kwargs['wmode'] = 'opaque'
    return embedly_oembed_provider(url, kwargs)

OEMBED_PROVIDER = 'path.to.module.my_provider'
# OEMBED_PROVIDER = my_provider # The function can be used too, not only
                                # the dotted python path.

The content is looking for templates in the following order in the folder content/external/:

  1. type of the embedded object (e.g. ‘video’) + .html

  2. type of the content type (e.g. ‘transparent’) + .html

  3. default.html

If you don’t want any surprises with blocked access to Embedly it is suggested that you register for a free API key.

Using the FeedContent

If you want to use the FeedContent, make sure you have feedparser in your Python path.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

feincms-oembed-1.4.0.tar.gz (10.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

feincms_oembed-1.4.0-py2.py3-none-any.whl (16.1 kB view details)

Uploaded Python 2Python 3

File details

Details for the file feincms-oembed-1.4.0.tar.gz.

File metadata

File hashes

Hashes for feincms-oembed-1.4.0.tar.gz
Algorithm Hash digest
SHA256 4cd79f4406eaa85a1984073152b585776b40fa82c58db49a6f4a645b3a7bc991
MD5 c303423391f47fca4458805113cd98df
BLAKE2b-256 39eecacacac891cf547a9764cc8c3fbcfd5d79bcf613d96f462f6e5062163f18

See more details on using hashes here.

File details

Details for the file feincms_oembed-1.4.0-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for feincms_oembed-1.4.0-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 4808bf9ed75aad07c54e39a4137af86f1b5c15500fda7b16cd2de068790900b6
MD5 5c9fc5809168bed95a3e39c23dd7a130
BLAKE2b-256 f5c2761771cb2aae5096f30b4f667cd1556b8c6106ddc2dec7caf8477f8596ee

See more details on using hashes here.

Release history Release notifications | RSS feed

2.0.0

2 files

1.5.1

2 files

1.5.0

2 files

1.4.1

2 files

This release

1.4.0 This release

2 files

1.3.3

2 files

1.3.2

2 files

1.3.1

2 files

1.3.0

2 files

1.2.0

2 files

1.1.0

1 file

1.0.1

1 file

1.0.0

1 file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page