Skip to main content

Django app for easy embedding social network widgets and plugins into your site. Supports Facebook, Twitter, Google+, YouTube, Instagram and Pinterest.

Project description

Downloads Documentation Status https://travis-ci.org/creafz/django-social-widgets.svg?branch=master https://coveralls.io/repos/creafz/django-social-widgets/badge.png?branch=master

Django app for easy embedding social network widgets and plugins into your site. Supports Facebook, Twitter, Google+, YouTube, Instagram and Pinterest.

Useful links: Documentation, Demo.

Requirements

  • Python 2.6, 2.7, 3.3 - 3.5

  • Django 1.6 or higher

Quickstart

  1. Install from PyPI:

    pip install django-social-widgets
  2. Add social_widgets to INSTALLED_APPS:

    INSTALLED_APPS = (
     ...
     "social_widgets",
     ...
    )
  3. Load the social_widgets template library in every template you want to use it:

    {% load social_widgets %}
  4. Place {% social_widget_render %} code where you want to show the widget. For example if you want to show Facebook Likebox for Facebook Developers page put this code in your template:

    {% social_widget_render 'facebook/likebox.html' href='https://www.facebook.com/FacebookDevelopers' %}

Passing parameters

Parameter names for widgets are similar to the original parameters with only one change: they use underscore instead of hyphen. So for example if you need to set show-screen-name parameter for Twitter Follow Button, you should use code like this:

{% social_widget_render "twitter/follow_button.html" username="BillGates" show_screen_name=True %}

As a value for all parameters you can use a Python value like string, integer or Boolean, for example:

{% social_widget_render "facebook/likebox.html" app_id=12345678 href="https://www.facebook.com/FacebookDevelopers" show_border=True %}

See this demo page with all supported widgets, their code and available parameters.

Example project

You can find an example project in “example_project” directory.

Facebook

Twitter

Google+

YouTube

Instagram

Pinterest

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-social-widgets-0.5.0.tar.gz (9.7 kB view details)

Uploaded Source

File details

Details for the file django-social-widgets-0.5.0.tar.gz.

File metadata

  • Download URL: django-social-widgets-0.5.0.tar.gz
  • Upload date:
  • Size: 9.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/45.2.0.post20200210 requests-toolbelt/0.9.1 tqdm/4.42.1 CPython/3.7.6

File hashes

Hashes for django-social-widgets-0.5.0.tar.gz
Algorithm Hash digest
SHA256 b6aea30a61b344ce9ab5be9bb2d5d37134dd73265a6b1d981890b9f3ef18abf0
MD5 e636db07531c08a06038413d734d35e6
BLAKE2b-256 8dbb0b1d407f605b43d7342b75d8f61325c91e9a91c52bf4bf83d2f2ea22135d

See more details on using hashes here.

Supported by

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