Skip to main content

Django app for easy embeding YouTube and Vimeo videos and music from SoundCloud.

Project description

django-embed-video

Django app for easy embedding YouTube and Vimeo videos and music from SoundCloud.

Jazzband https://travis-ci.org/jazzband/django-embed-video.png?branch=master https://coveralls.io/repos/yetty/django-embed-video/badge.png?branch=master

Documentation

Documentation is here: http://django-embed-video.rtfd.org/

Quick start

  1. Install django-embed-video:

    pip install django-embed-video

    or from sources

    pip install git+https://github.com/jazzband/django-embed-video
  2. Add embed_video to INSTALLED_APPS in your Django settings.

  3. If you want to detect HTTP/S in template tags, you have to set request context processor in settings.TEMPLATES:

    TEMPLATES = [
        {
            'BACKEND': 'django.template.backends.django.DjangoTemplates',
            # ...
            'OPTIONS': {
                'context_processors': [
                    # ...
                    'django.template.context_processors.request',
                ],
            },
        },
    ]
  4. Usage of template tags:

    {% load embed_video_tags %}
    
    <!-- The video tag: -->
    {% video item.video as my_video %}
      URL: {{ my_video.url }}
      Thumbnail: {{ my_video.thumbnail }}
      Backend: {{ my_video.backend }}
    
      {% video my_video "large" %}
    {% endvideo %}
    
    <!-- Or embed shortcut: -->
    {% video my_video '800x600' %}
  5. Usage of model fields

    from django.db import models
    from embed_video.fields import EmbedVideoField
    
    class Item(models.Model):
        video = EmbedVideoField()  # same like models.URLField()

Contributing

This is a Jazzband project. By contributing you agree to abide by the Contributor Code of Conduct and follow the guidelines.

Changes

Release 1.3.3 (June 10, 2020)

  • Fix admin UI exception with form validation.

Release 1.3.2 (March 29, 2020)

  • Add support for Soundcloud mobile URLs.

Release 1.3.1 (January 6, 2020)

  • Add support for Vimeo review video URLs.

  • Update example project code.

Release 1.3 (August 30, 2019)

  • Drop unsupported Python version prior to 3.6.

  • Drop unsupported Django versions prior to 1.11.

  • Add support for Python up to 3.8 including PyPy.

  • Add support for Django up to 2.2.

  • Improve project structure, docs and language.

  • Improve CI and CD infrastructure and automation.

  • Move project to Jazzband organization.

Release 1.2.0 (October 04, 2018)

  • hotfix docs directive (#94)

  • update docs (#92)

  • use tests_require and setup_requires for nose testing requirements (#91)

  • add renderer kwarg to Widget render method to support Python 2.1 and later (#88)

  • enable default HTTPS support for YouTube, VimeoBackend, SoundCloudBackend (#86)

  • added syntax highlight in README.rst (#81)

  • updating requests >=2.19

Release 1.1.2 (April 27, 2017)

  • fix pypi

Release 1.1.1 (March 24, 2017)

  • updates for Django 1.10 and 1.11 (#73)

  • update requirements for installation of the example project (#72)

  • use secure connection to query soundcloud endpoint (#68)

Release 1.1.0 (Jan 19, 2016)

  • added support fort Django 1.9 (#52)

  • if possible YouTube thumbnails are returned in better resolution (#43)

Release 1.0.0 (May 01, 2015)

Backward incompatible changes:

  • filter embed_video_tags.embed has been removed

  • changed behaviour of extra params in video tag (#34, #36)

Backward compatible changes:

  • added support for Django 1.7 and Django 1.8

  • added support for Vimeo channels (#47)

  • fix resizing of SoundCloud iframe (#41)

Release 0.11 (July 26, 2014)

  • add support for YouTube mobile urls (#27)

  • fix passing parameters in calling request library (#28)

  • fix validation of urls (#31)

Release 0.10 (May 24, 2014)

  • video tag accepts kwargs (#20)

  • video tag will not crash anymore with None passed as url (#24)

Release 0.9 (Apr. 04, 2014)

  • Add VideoBackend.template_name and rendering embed code from file.

  • Allow relative sizes in template tag (#19).

  • Fix handling invalid urls of SoundCloud. (#21).

  • Catch VideoDoesntExistException and UnknownBackendException in template tags and admin widget.

  • Add base exception EmbedVideoException.

Release 0.8 (Feb. 22, 2014)

  • Add EMBED_VIDEO_TIMEOUT to settings.

  • Fix renderering template tag if no url is provided (#18)

  • If EMBED_VIDEO_TIMEOUT timeout is reached in templates, no exception is raised, error is just logged.

  • Fix default size in template tag. (See more…)

Release 0.7 (Dec. 21, 2013)

  • Support for sites running on HTTPS

  • embed filter is deprecated and replaced by video filter.

  • caching for whole backends was removed and replaced by caching properties

  • minor improvements on example project (fixtures, urls)

Release 0.6 (Oct. 04, 2013)

  • Ability to overwrite embed code of backend

  • Caching backends properties

  • PyPy compatibility

  • Admin video mixin and video widget

Release 0.5 (Sep. 03, 2013)

  • Added Vimeo thumbnails support

  • Added caching of results

  • Added example project

  • Fixed template tag embed

  • Fixed raising UnknownIdException in YouTube detecting.

Release 0.4 (Aug. 22, 2013)

Release 0.3 (Aug. 20, 2013)

  • Security fix: faked urls are treated as invalid. See this page for more details.

  • Fixes:

    • allow of empty video field.

    • requirements in setup.py

  • Added simplier way to embed video in one-line template tag:

    {{ 'http://www.youtube.com/watch?v=guXyvo2FfLs'|embed:'large' }}
  • backend variable in video template tag.

    Usage:

    {% video item.video as my_video %}
        Backend: {{ my_video.backend }}
    {% endvideo %}

Release 0.2 (June 25, 2013)

  • Support of SoundCloud

Release 0.1 (June 1, 2013)

  • Initial release

Project details


Download files

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

Source Distribution

django-embed-video-1.3.3.tar.gz (36.6 kB view details)

Uploaded Source

Built Distribution

django_embed_video-1.3.3-py3-none-any.whl (24.3 kB view details)

Uploaded Python 3

File details

Details for the file django-embed-video-1.3.3.tar.gz.

File metadata

  • Download URL: django-embed-video-1.3.3.tar.gz
  • Upload date:
  • Size: 36.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.44.1 CPython/3.7.4

File hashes

Hashes for django-embed-video-1.3.3.tar.gz
Algorithm Hash digest
SHA256 7b5149c3ae51f78ddc7bd0e381f63beaf0aad30061815579d3a105e99a3ccbb2
MD5 44e7da6cad3f7eb0370c96aff5929149
BLAKE2b-256 d885e31d243ab63effecfff3fe734d92b7bc24f28bf8841f2156a2c05f6f386d

See more details on using hashes here.

File details

Details for the file django_embed_video-1.3.3-py3-none-any.whl.

File metadata

  • Download URL: django_embed_video-1.3.3-py3-none-any.whl
  • Upload date:
  • Size: 24.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.44.1 CPython/3.7.4

File hashes

Hashes for django_embed_video-1.3.3-py3-none-any.whl
Algorithm Hash digest
SHA256 ef59264ce1733743ccda329532161140cd975a4e291f01cd68c9b888c20288c0
MD5 99f016043c06b8295f4a7a0b3fa04e39
BLAKE2b-256 68fc9df331b7a7e3f8f5d12e4498b4d38292e78f3b2190899458fe6adf70c601

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page