From 64127cdce50e685638331b29c9568bff034057a2 Mon Sep 17 00:00:00 2001 From: Juda Kaleta Date: Thu, 22 Aug 2013 10:53:31 +0200 Subject: [PATCH] Documentation link and Quick start --- CHANGES.rst | 12 +++--- README.rst | 114 +++++++++++++--------------------------------------- 2 files changed, 34 insertions(+), 92 deletions(-) diff --git a/CHANGES.rst b/CHANGES.rst index b32ef96..d1a2af2 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -1,8 +1,8 @@ Changes ******* -0.3 ------- +Release 0.3 (Aug. 20, 2013) +---------------------------- - Security fix: faked urls are treated as invalid. See `this page `_ @@ -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 diff --git a/README.rst b/README.rst index ee81b53..80bcbef 100644 --- a/README.rst +++ b/README.rst @@ -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 +Documentation is here: https://django-embed-video.rtfd.org/ + + +Quick start ************ -:: +#. Install ``django-embed-video``: - pip install django-embed-video + :: + + pip install django-embed-video -or from sources + or from sources -:: + :: - pip install git+https://github.com/yetty/django-embed-video.git + pip install git+https://github.com/yetty/django-embed-video.git -Add ``embed_video`` to ``INSTALLED_APPS`` in your Django settings. +#. Add ``embed_video`` to ``INSTALLED_APPS`` in your Django settings. -Examples -******** +#. Use template tags: -Template examples ------------------ + :: -First you have to load the `embed_video_tags` template tags in your template: + {% load embed_video_tags %} -:: - - {% load embed_video_tags %} - -Simple embeding of video: - -:: - - {% 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: - -:: - - {{ my_video|embed:'800x600' }} - -Usage of variables: - -:: - - {% 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 %} + {% endvideo %} + Or embed shortcut: + {{ my_video|embed:'800x600' }} -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. +#. Use model fields -:: + :: - {{ '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 `_ -rules and `Zen `_. - - - -TODO -***** - -- provide AdminEmbedVideoMixin -- Vimeo thumbnail - - - -Websites using django-embed-video -********************************* - -- `Tchorici.cz `_ (`sources - `_) - -*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: