Metadata-Version: 2.4
Name: django-addthis
Version: 3.0.3
Summary: Simple integration of the AddThis social sharing widget for Django projects.
Author-email: Raymond Wanyoike <raymond.wanyoike@gmail.com>
Maintainer-email: Basil Shubin <basil.shubin@gmail.com>
License-Expression: GPL-3.0-only
Project-URL: download, https://github.com/bashu/django-addthis/zipball/master
Project-URL: homepage, https://github.com/bashu/django-addthis/
Classifier: Development Status :: 5 - Production/Stable
Classifier: Environment :: Web Environment
Classifier: Framework :: Django
Classifier: Framework :: Django :: 5.2
Classifier: Framework :: Django :: 6.0
Classifier: Framework :: Django :: 6.1
Classifier: Intended Audience :: Developers
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Classifier: Topic :: Internet :: WWW/HTTP
Classifier: Topic :: Internet :: WWW/HTTP :: Dynamic Content
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Requires-Python: >=3.10
Description-Content-Type: text/x-rst
License-File: LICENSE
License-File: AUTHORS
Requires-Dist: django>=5.2
Dynamic: license-file

django-addthis
==============

.. image:: https://badge.fury.io/py/django-addthis.svg
    :target: https://badge.fury.io/py/django-addthis

.. image:: https://img.shields.io/pypi/pyversions/django-addthis.svg
    :target: https://pypi.python.org/pypi/django-addthis/

.. image:: https://img.shields.io/pypi/djversions/django-addthis.svg
    :target: https://pypi.python.org/pypi/django-addthis/

.. image:: https://github.com/bashu/django-addthis/actions/workflows/test.yml/badge.svg
    :target: https://github.com/bashu/django-addthis/actions/workflows/test.yml

A simple integration of the `AddThis <http://www.addthis.com>`_ social sharing widget for Django_ projects.

Maintained by `Basil Shubin <https://github.com/bashu/>`_, and some great
`contributors <https://github.com/bashu/django-addthis/contributors>`_.

Installation
------------

First install the module, preferably in a virtual environment. It can be installed from PyPI:

.. code:: shell

    pip install django-addthis

Setup
-----

You'll need to add ``addthis`` to ``INSTALLED_APPS`` in your project's ``settings.py`` file:

.. code:: python

    INSTALLED_APPS += [
        'addthis',
    ]

Configuration
-------------

The ``addthis_widget`` template tag requires a site *profile id*: ``pub_id``. Either pass it as ``pub_id``, or set ``PUB_ID`` in your ``ADDTHIS_SETTINGS`` settings dictionary:

.. code:: python

    ADDTHIS_SETTINGS = {
        'PUB_ID': 'xx-xxxxxxxxxxxxxxxx',
        ...
    }

The site *profile id* can be found by visiting its Profile Options page on `AddThis <http://www.addthis.com>`_ (**ID:**).

There are a few `configuration options <http://support.addthis.com/customer/portal/articles/1337994-the-addthis_config-variable>`_ for ``addthis`` that can be placed in your ``ADDTHIS_SETTINGS`` settings dictionary:

============================ ============================
Option                       Default
============================ ============================
USERNAME
SERVICES_EXCLUDE
SERVICES_COMPACT
SERVICES_EXPANDED
SERVICES_CUSTOM
UI_CLICK                     False
UI_DELAY                     0
UI_HOVER_DIRECTION           0
UI_LANGUAGE
UI_OFFSET_TOP                0
UI_OFFSET_LEFT               0
UI_HEADER_COLOR
UI_HEADER_BACKGROUND
UI_COBRAND
UI_USE_CSS                   True
UI_USE_ADDRESSBOOK           False
UI_508_COMPLIANT             False
DATA_TRACK_CLICKBACK         True
DATA_GA_TRACKER
============================ ============================

Please see the ``example`` application. This application is used to
manually test the functionalities of this package. This also serves as
a good example.

You need Django 1.8 or above to run that. It might run on older versions but that is not tested.

Usage
-----

#.  First of all, load the ``addthis`` in every template where you want to use it:

    .. code:: html+django

        {% load addthis %}

    then load the widget:

    .. code:: html+django

        {% addthis_widget %}

#.  Visit the AddThis `Get the Code <http://www.addthis.com/get>`_ page and create/generate your social sharing code, e.g:

    .. code:: html+django

        <!-- Go to www.addthis.com/dashboard to customize your tools -->
        <div class="addthis_sharing_toolbox"></div>

    Be sure to omit the:

    .. code:: html+django

        <script type="text/javascript" src="//s7.addthis.com/js/300/addthis_widget.js#pubid=xx-xxxxxxxxxxxxxxxx"></script>

    part of the (generated) code as the ``addthis_widget`` template tag takes care of this.

Example
~~~~~~~

.. code:: html+django

    {% load addthis %}

    <!DOCTYPE html>

    <html>
    <head>
      <meta charset="utf-8">
      <title>django-addthis Example</title>
    </head>

    <body>
      <!-- Go to www.addthis.com/dashboard to customize your tools -->
      <div class="addthis_sharing_toolbox"></div>

      <p>Well, the way they make shows is, they make one show. That show's
      called a pilot. Then they show that show to the people who make shows,
      and on the strength of that one show they decide if they're going to
      make more shows. Some pilots get picked and become television programs.
      Some don't, become nothing. She starred in one of the ones that became
      nothing.</p>

      <!-- Placed at the end of the document so the page load faster -->
      {% addthis_widget %}
    </body>
    </html

Contributing
------------

If you've found a bug, implemented a feature or customized the template and
think it is useful then please consider contributing. Patches, pull requests or
just suggestions are welcome!

Credits
-------

`django-addthis <https://github.com/bashu/django-addthis/>`_ was originally started by `Raymond Wanyoike <https://github.com/rwanyoike>`_ who has now unfortunately abandoned the project.

License
-------

``django-addthis`` is released under the GNU GPL v3 license.

.. _django: https://www.djangoproject.com

Changes
-------

3.0.3 (2026-08-14)
~~~~~~~~~~~~~~~~~~

* Modernize packaging: switch from ``setup.py``/``setup.cfg`` to ``pyproject.toml``
* Replace Travis CI with GitHub Actions for tests and PyPI releases
* Add Dependabot and pre-commit configuration
* Support Django 5.2, 6.0 and 6.1; drop support for Python < 3.10
* Clean up ruff lint findings in template tags and tests

3.0.2 (2021-09-13)
~~~~~~~~~~~~~~~~~~

* Made sure the app runs on Django 3.2

3.0.1 (2020-10-13)
~~~~~~~~~~~~~~~~~~

* Nothing...

3.0.0 (2015-08-04)
~~~~~~~~~~~~~~~~~~

* Support Django 1.6+
* New template tag

2.0.2 (2015-03-26)
~~~~~~~~~~~~~~~~~~

* Refactor

2.0.1 (2014-11-24)
~~~~~~~~~~~~~~~~~~

* Add GNU GPL v3.0 license

2.0.0 (2014-11-24)
~~~~~~~~~~~~~~~~~~

* New configuration options
* New settings definition
* Works with the new AddThis widgets (http://www.addthis.com/blog/2014/06/10/whats-new-in-your-addthis-dashboard/)

1.0.1 (2014-11-24)
~~~~~~~~~~~~~~~~~~

* Fix/Remove invalid "ui_use_css" config

1.0.0 (2014-11-24)
~~~~~~~~~~~~~~~~~~

* Initial release
