python-social-auth - how could I disconnect in Django?

≡放荡痞女 提交于 2019-12-23 04:17:28

问题


I'm using a tag with href like /disconnect/backend/ and then it shows me an empty page. I've tried {% url %} template tag like:

{% url 'social:disconnect' 'twitter' %}

And it's still create same url as I've used in the tag. How could I disconnect account? Or maybe there are also a way to get only one account associated?


回答1:


Answer is very simple. You should use POST request. I've done it like those:

<form action="{% url 'social:disconnect' 'twitter' %}" method="post">
    {% csrf_token %}
    <button class="btn btn-warning btn-xs">
        Disconnect
    </button>
</form>


来源:https://stackoverflow.com/questions/31788762/python-social-auth-how-could-i-disconnect-in-django

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!