简体   繁体   中英

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

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?

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>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM