Package: django-social-share
Provides templatetags for:‘Tweet This’‘Share this on Facebook’‘Share on Google+’‘Share on LinkedIn’‘Share on Telegram’‘Share on WhatsApp’‘mailto://’.‘Save to Pinterest’‘Copy to Clipboard’Plain HTMLtemplatesare provided for your convenience, but you can override them to provide your own look and feel.Installation$ python -m pip install django-social-shareAdd the app toINSTALLED_APPS:INSTALLED_APPS += ['django_social_share']You will also have to adddjango.template.context_processors.requestto yourcontext_processorslist. This way the templatetags will use the correct scheme and hostname:TEMPLATES=[
    {
        'BACKEND': 'django.template.backends.django.DjangoTemplates',
        'DIRS': [
            os.path.join(BASE_DIR, 'templates'),
        ],
        'OPTIONS': {
            'context_processors': [
                'django.template.context_processors.request',
            ],
        }
    },
]Note in most cases sharing will not work if you are usinglocalhostor your domain is otherwise not accessible from the public internet. For testing local development, you can use a service likengrok, and set yourSite instance’sdomainto the hostname provided byngrok.Usage{% post_to_facebook <object_or_url> <link_text> <link_class> %}

{% post_to_gplus <object_or_url> <link_text> <link_class> %}

{% post_to_twitter <text_to_post> <object_or_url> <link_text> <link_class> %}

{% post_to_linkedin <object_or_url> <link_class> %}

{% send_email <subject> <text_to_post> <object_or_url> <link_text> <link_class> %}

{% post_to_reddit <text_to_post> <object_or_url> <link_text> <link_class> %}

{% post_to_telegram <text_to_post> <object_or_url> <link_text>  <link_class> %}

{% post_to_whatsapp <object_or_url> <link_text> <link_class> %}

{% save_to_pinterest <object_or_url>  <link_class> %}

{% add_pinterest_script %}

{% copy_to_clipboard <object_or_url> <link_text> <link_class> %}

{% add_copy_script %}<text_to_post>may contain any valid Django Template code. Note that Facebook does not support this anymore.<object_or_url>is optional (except Telegram). If you pass a django model instance, it will use itsget_absolute_urlmethod. Additionally, if you havedjango_bitlyinstalled, it will use its shortUrl on Twitter.<link_text>is also optional. It defines the text used for theaelement. Defaults to ‘Post to Facebook’ and ‘Post to Twitter’.<subject>may contain any valid Django Template code.{% post_to_twitter_url <text_to_post> <object_or_url> %}Will add atweet_urlvariable to the context, containing the URL for the Twitter sharer popup.{% post_to_facebook_url <object_or_url> %}Will add afacebook_urlvariable to the context, containing the URL for the Facebook sharer popup.{% post_to_gplus_url <object_or_url> %}Will add agplus_urlvariable to the context, containing the URL for the Google+ sharer popup.{% send_email_url <subject> <text_to_post> <object_or_url> <link_text> %}Will add amailto_urlvariable to the context, containing the URL for themailtoanchor.{% post_to_reddit_url <text> <object_or_url> %}Will add areddit_urlvariable to the context, containing the URL for the Reddit poster page.{% post_to_telegram <text> <object_or_url> %}Will add atelegram_urlvariable to the context, containing the URL for the Telegram sharer popup.{% post_to_whatsapp_url <object_or_url> %}Will add awhatsapp_urlvariable to the context, containing the URL for the WhatsApp sharer.{% save_to_pinterest_url <object_or_url> %}Will add apinterest_urlvariable to the context, containing the URL for the Pinterest sharer.{% copy_to_clipboard <object_or_url> <link_text> <link_class> %}will add acopy_urlvariable to the context, containing the URL for the link to copy.Example:{% load social_share %}

{% post_to_facebook object_or_url "Post to Facebook!" %}
{% post_to_twitter "New Song: {{object.title}}. Check it out!" object_or_url "Post to Twitter" %}
{% post_to_gplus object_or_url "Post to Google+!" %}
{% post_to_linkedin object_or_url %}
{% send_email object.title "New Song: {{object.title}}. Check it out!" object_or_url "Share via email" %}
{% post_to_reddit "New Song: {{object.title}}" <object_or_url> %}
{% post_to_telegram "New Song: {{object.title}}" <object_or_url> %}
{% post_to_whatsapp object_or_url "Share via WhatsApp" %}
{% save_to_pinterest object_or_url %}
{% add_pinterest_script %} // Required for save_to_pinterest. Add to the end of body tag.
{% copy_to_clipboard object_or_url "Copy to clipboard!" %}
{% add_copy_script %} // Required for copy_to_clipboard. Add to the end of body tag.TemplatesTemplates are in:django_social_share/templatetags/post_to_twitter.htmldjango_social_share/templatetags/post_to_facebook.htmldjango_social_share/templatetags/post_to_gplus.htmldjango_social_share/templatetags/send_email.htmldjango_social_share/templatetags/post_to_linkedin.htmldjango_social_share/templatetags/post_to_reddit.html.django_social_share/templatetags/post_to_telegram.html.django_social_share/templatetags/post_to_whatsapp.html.django_social_share/templatetags/save_to_pinterest.html.django_social_share/templatetags/pinterest_script.html.django_social_share/templatetags/copy_to_clipboard.html.django_social_share/templatetags/copy_script.html.You can override them to suit your mileage.IssuesIf you have any issues, please useGitHub’s issues.
Please refrain from emailing the author.