Git Product home page Git Product logo

django-embed-video's Introduction

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

django-embed-video's People

Contributors

aleksihakli avatar bashu avatar batisteo avatar bburan avatar calzzetta avatar cedriccarrard avatar hopiu avatar koterpillar avatar marcosguedes avatar mgrdcm avatar nossila avatar rolo avatar salahaddin avatar sergiobrr avatar szuliq avatar techdragon avatar thijstriemstra avatar yetty avatar z4r avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.