Skip to main content

A simple Django app to generate embed code from youtube, twitter and slideshare.

Project description

Embed is a Django app to generate the embed code for youtube, twitter and slideshare.

Detailed documentation is in the “docs” directory.

Quick start

  1. Add “embed” to your INSTALLED_APPS setting like this:

    INSTALLED_APPS = (
        ...
        'embed',
    )
  2. Run python manage.py syncdb to create the embed cache model.

  3. Import Embed class.

    from embed.utils import Embed

  1. You can use it individually for each service or all of them.

    youtube = Embed.get_youtube_embed(string=”Check this video https://youtu.be/THgLyTucjmk”)

  2. The Embed will return a string with the link replaced with the embed code.

  3. If you want use the twitter functionality you have to set your twitter api keys.

    Embed.consumer_key = ‘dummy-consumer-key’ Embed.consumer_secret = ‘dummy-consumer-secret’ Embed.oauth_token = ‘dummy-access-token’ Embed.oauth_token_secret = ‘dummy-access-token-secret’

  4. You can set the parameters for the embed objects.

    Embed.config[‘width’] = ‘430’

  5. If you are using MySQL you need to encode to utf-8 the “embed_code” column of the EmbedCache table in your database.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

django-embed-0.2.1.tar.gz (90.4 kB view details)

Uploaded Source

File details

Details for the file django-embed-0.2.1.tar.gz.

File metadata

  • Download URL: django-embed-0.2.1.tar.gz
  • Upload date:
  • Size: 90.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for django-embed-0.2.1.tar.gz
Algorithm Hash digest
SHA256 5fb0d8243ecaeff1f0b5159bda4318e686d216cdfd006261180d051e74f2a4ac
MD5 cc352e3cb2cbfd350de8b40acf0a864c
BLAKE2b-256 9fc6176296fec20df53ba999a8098265239349da6e962eadb4f50b6e4d8b41fd

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page