Embed Videos for Wagtail CMS
Project description
wagtail-embedvideos
Simple app that works similar to wagtailimages, but for embedding YouTube and Vimeo videos and music from SoundCloud.
Maintained by Basil Shubin, and some great contributors.
Compatibility
The current version is tested for compatiblily with the following:
Wagtail versions 2.7 to 2.11
Django versions 2.2 to 3.2
Python versions 3.6 and 3.9
Requirements
You must have django-embed-video installed and configured, see the django-embed-video documentation for details and setup instructions.
Installation
First install the module, preferably in a virtual environment. It can be installed from PyPI:
pip install wagtail-embedvideos
Setup
Make sure the project is configured for django-embed-video.
Then add the following settings:
INSTALLED_APPS += (
"wagtail_embed_videos",
)
Then run ./manage.py migrate to create the required database tables.
Usage
In models, implement as a ForeignKey relation, same as wagtailimages.
# models.py
from wagtail.core.models import Page, PageBase
from wagtail_embed_videos import get_embed_video_model_string
from wagtail_embed_videos.edit_handlers import EmbedVideoChooserPanel
class CustomPage(Page):
video = models.ForeignKey(
get_embed_video_model_string(),
null=True, blank=True,
on_delete=models.SET_NULL,
related_name='+'
)
# ...
content_panels = [
EmbedVideoChooserPanel('video'),
]
In templates, load the embed_video_tags library in every template where you want to use it:
<!-- custom_page.html -->
{% load embed_video_tags %}
{% video self.video.url as my_video %}
{% video my_video 'small' %}
{% endvideo %}
Check django-embed-video documentation for more details.
Contributing
If you like this module, forked it, or would like to improve it, please let us know! Pull requests are welcome too. :-)
Credits
wagtail-embedvideos was originally started by InfoPortugal, S.A. who has now unfortunately abandoned the project.
License
wagtail-embedvideos is released under the BSD license.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for wagtail-embedvideos-0.5.3.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | c05fc8cb16147c4519d68f3d685f57c54e85f557348ddc9f22075084e3897ed6 |
|
MD5 | 42c003316c1e37e65ef523c9dff70916 |
|
BLAKE2b-256 | 09d51a02fb5701f0f4fc055fe53bb4ba67869032fd1d5512f96669ff64d6d18b |
Hashes for wagtail_embedvideos-0.5.3-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | cb8d9f2e01d8f59a2e3688ed5443c993ef9763c638018cd74d69465540c32cf8 |
|
MD5 | f2988a30f4c8bd4edef04f9805918a3c |
|
BLAKE2b-256 | 8d57a4dcd474806cce999d559d3e4dd763e5d70942913808b0aec05a5a73cf4f |