Django app for easy embedding YouTube and Vimeo videos and music from SoundCloud.
Find a file
2014-09-20 12:22:23 +02:00
docs Merge branch 'patch-1' of https://github.com/SalahAdDin/django-embed-video into SalahAdDin-patch-1 2014-09-20 12:21:55 +02:00
embed_video Can't resize Soundcloud iframe 2014-08-28 02:16:05 +02:00
example_project Minor codestyle improvements 2014-02-22 10:22:58 +01:00
.coveragerc Omit redundant files in coverage 2013-08-22 14:59:06 +02:00
.gitignore Ignore output of coverage html 2013-07-31 10:14:57 +02:00
.travis.yml Closes #39. Remove --use-mirrors from travis 2014-07-29 10:06:00 +02:00
CHANGES.rst Fix rst 2. [skip ci] 2014-08-01 09:44:02 +02: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 Fix spelling mistake in README 2014-01-07 10:05:38 +01:00
setup.py python setup.py test 2014-04-04 19:51:15 +02:00

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

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

.. image:: https://travis-ci.org/yetty/django-embed-video.png?branch=master
    :target: https://travis-ci.org/yetty/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
.. image:: https://pypip.in/v/django-embed-video/badge.png
    :target: https://crate.io/packages/django-embed-video/
.. image:: https://pypip.in/d/django-embed-video/badge.png
    :target: https://crate.io/packages/django-embed-video/

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/yetty/django-embed-video.git


#. 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.TEMPLATE_CONTEXT_PROCESSORS``:

   ::

       TEMPLATE_CONTEXT_PROCESSORS = (
           ...
           'django.core.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()


.. vim: set tw=80: