Giter Site home page Giter Site logo

django-socialsharing's Introduction

Socialsharing

This project is a simple integration of various social sharing services for quick integration into Django projects. See the list of supported sharing in the Usage section below.

Installation

Add socialsharing to INSTALLED_APPS in settings.py.

Usage

addthis

The addthis templatetag will insert the necessary scripts to make use of the AddThis widget.

Basic usage:

{% addthis pubid=xxxxxxxxxx %}

or with ADDTHIS_PUBID defined in settings.py:

{% addthis %}

The only required argument is pubid. You may optionally provide a global setting for this by adding ADDTHIS_PUBID = xxxxxx to your settings.py. Setting this value means that you can omit the pubid argument when invoking the templatetag.

Optional settings:

share_url: The url to share. Pass this argument to override the default AddThis value (the URL of the page being viewed). Example:

{% addthis 'http://myurl.com' %}

track_clickback: From the AddThis docs:

Set to true to allow us to append a variable to your URLs upon sharing. 
We'll use this to track how many people come back to your content via links 
shared with AddThis. Highly recommended.

default value is True.
Note: You may optionally set ADDDTHIS_TRACK_CLICKBACK = False to always force this value to False.

To enable tracking via Google Analytics:

  • add ADDTHIS_GA_TRACKING_ENABLED = True to your settings.py
  • add ADDTHIS_GA_TRACKER = UA-XXXXXX-X to your settings.py

Note: If you don't set ADDDTHIS_GA_TRACKER, the template tag will attempt to fall back to GA_TRACKING_CODE (which is used by Django-HTML5Boilerplate).

django-socialsharing's People

Contributors

lettertwo avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  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.