Django app for easy embedding YouTube and Vimeo videos and music from SoundCloud.
Find a file
2017-04-20 13:34:23 +02:00
docs fix test soundcloud and update docs (#66) 2016-11-14 22:37:51 +01:00
embed_video Merge branch 'master' into master 2017-04-20 13:34:23 +02:00
example_project Updates for Django 1.10 and 1.11 (#73) 2017-04-20 13:33:28 +02:00
.coveragerc Omit redundant files in coverage 2013-08-22 14:59:06 +02:00
.gitignore Test support for Django 1.7 2014-09-26 18:53:43 +02:00
.travis.yml Updates for Django 1.10 and 1.11 (#73) 2017-04-20 13:33:28 +02:00
CHANGES.rst fix test soundcloud and update docs (#66) 2016-11-14 22:37:51 +01:00
LICENSE License 2013-05-31 13:25:11 +02:00
MANIFEST.in Fixes #22. Include html templates. 2014-03-25 22:11:57 +01:00
README.rst Updates for Django 1.10 and 1.11 (#73) 2017-04-20 13:33:28 +02:00
setup.py fix test soundcloud and update docs (#66) 2016-11-14 22:37:51 +01:00

django-embed-video
==================

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

.. image:: https://jazzband.co/static/img/badge.svg
   :target: https://jazzband.co/
   :alt: Jazzband
.. image:: https://travis-ci.org/jazzband/django-embed-video.png?branch=master
    :target: https://travis-ci.org/jazzband/django-embed-video
.. image:: https://coveralls.io/repos/yetty/django-embed-video/badge.png?branch=master
    :target: https://coveralls.io/r/yetty/django-embed-video?branch=master

Documentation
*************

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


Quick start
************

#. Install ``django-embed-video``:

   ::

      pip install django-embed-video


   or from sources

   ::

      pip install git+https://github.com/jazzband/django-embed-video


#. Add ``embed_video`` to ``INSTALLED_APPS`` in your Django settings.

#. 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',
                   ],
               },
           },
       ]

#. 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' %}

#. 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()