hramezani / django-embed-video

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

Home Page:http://django-embed-video.rtfd.org/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

django-embed-video

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

Jazzband

image

image

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.

About

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

http://django-embed-video.rtfd.org/

License:MIT License


Languages

Language:Python 96.9%Language:HTML 3.1%