Search code examples
pythondjangopython-social-auth

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?


Solution

  • 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>