Skip to content

Commit

Permalink
Documentation link and Quick start
Browse files Browse the repository at this point in the history
  • Loading branch information
yetty committed Aug 22, 2013
1 parent 6f23148 commit 64127cd
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 90 deletions.
12 changes: 6 additions & 6 deletions CHANGES.rst
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
Changes
*******

0.3
------
Release 0.3 (Aug. 20, 2013)
----------------------------

- Security fix: faked urls are treated as invalid. See `this page
<https://github.com/yetty/django-embed-video/commit/d0d357b767e324a7cc21b5035357fdfbc7c8ce8e>`_
Expand All @@ -27,12 +27,12 @@ Changes
{% endvideo %}


0.2
-----
Release 0.2 (June 25, 2013)
----------------------------

- Support of SoundCloud

0.1
-----
Release 0.1 (June 1, 2013)
----------------------------

- Initial release
110 changes: 26 additions & 84 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -12,115 +12,57 @@ Django app for easy embeding YouTube and Vimeo videos and music from SoundCloud.
.. image:: https://pypip.in/d/django-embed-video/badge.png
:target: https://crate.io/packages/django-embed-video/

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

Installation
************

::

pip install django-embed-video


or from sources

::

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

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

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

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

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

Template examples
-----------------
::

First you have to load the `embed_video_tags` template tags in your template:
pip install django-embed-video

::

{% load embed_video_tags %}
or from sources

Simple embeding of video:
::

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

{% video item.video as my_video %}
{{ my_video|embed:'small' }}
{% endvideo %}

Default sizes are ``tiny`` (420x315), ``small`` (480x360), ``medium`` (640x480),
``large`` (960x720) and ``huge`` (1280x960). You can set your own size:
#. Add ``embed_video`` to ``INSTALLED_APPS`` in your Django settings.

::

{{ my_video|embed:'800x600' }}
#. Use template tags:

Usage of variables:
::

::
{% load embed_video_tags %}

{% video item.video as my_video %}
The video tag:
{% video item.video as my_video %}
URL: {{ my_video.url }}
Thumbnail: {{ my_video.thumbnail }}
Backend: {{ my_video.backend }}
{% endvideo %}


There is a simplier way, if you don't need work with parameters as
``my_video.url`` or ``my_video.thumbnail`` and you want to use just ``embed``
tag.

::

{{ 'http://www.youtube.com/watch?v=guXyvo2FfLs'|embed:'large' }}




Model examples
---------------

Using the EmbedVideoField provides you validation of URLs.

::

from django.db import models
from embed_video.fields import EmbedVideoField

class Item(models.Model):
video = EmbedVideoField() # same like models.URLField()




Contributing
*************

I will be really pleased if you will provide patch to this Django app. Feel free
in changing source code, but please keep `PEP8 <http://www.python.org/dev/peps/pep-0008/>`_
rules and `Zen <http://www.python.org/dev/peps/pep-0020/>`_.



TODO
*****

- provide AdminEmbedVideoMixin
- Vimeo thumbnail

{% endvideo %}

Or embed shortcut:
{{ my_video|embed:'800x600' }}

Websites using django-embed-video
*********************************
#. Use model fields

- `Tchorici.cz <http://www.tchorici.cz>`_ (`sources
<https://github.com/yetty/Tchorici/>`_)
::

*Are you using django-embed-video? Send pull request!*
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:

0 comments on commit 64127cd

Please sign in to comment.