我想在 Django 模板中的帖子末尾设置一个社交链接。如何使用 Django 帖子中的社交媒体链接在社交中分享我的帖子?
问问题
15698 次
2 回答
12
查看 django-social-share ( https://github.com/fcurella/django-social-share ) 或 django-socialsharing ( https://github.com/lettertwo/django-socialsharing )。
于 2014-01-31T13:13:33.810 回答
4
我发现了一些东西。对于谷歌、Linkedin、Facebook:
<a href="https://plus.google.com/share?url=http://your-domain{{ request.get_full_path|urlencode }}"></a>
<a href="http://www.linkedin.com/shareArticle?url=http://your-domain{{ request.get_full_path|urlencode }}&title=<your title>&summary=<your desc>&source=http://your-domain"></a>
<a href="http://www.facebook.com/sharer/sharer.php?u=http://your-domain{{ request.get_full_path|urlencode }}"></a>
此外,这个插件(django-social-share)非常好。您可以通过以下方式安装它:
pip install django-social-share
要使用此插件,请参阅文档页面
于 2016-05-26T11:09:42.673 回答