A
A
albertalexandrov2018-03-08 18:22:52
Django
albertalexandrov, 2018-03-08 18:22:52

Can't register with VK and allauth?

Hello!
For some reason, it is not possible to implement registration through VKontakte using django-allauth. Always returns an error

KeyError at /accounts/vk/login/callback/
'response'

Cannot find key 'response'. Therefore, instead of the necessary data, VKontakte returns something wrong. What could it be and how can I check it?
In template:
{% load socialaccount %}
<a href='{% provider_login_url "vk" %}'>ВКонтакте</a>

5aa154da66b47939105345.jpeg

Answer the question

In order to leave comments, you need to log in

1 answer(s)
N
NorthWood69, 2019-06-08
@NorthWood69

At the moment, two changes need to be made to solve this problem:
1. In the allauth/socialaccount/providers/vk/views.py file , in the complete_login method in the params variable, change 'v': '3.00' to 'v': '5.00' .
2. In the allauth/socialaccount/providers/vk/provider.py file, in the extract_uid method, replace the line return str(data['uid']) with return str(data['id'])
PS version allauth 0.39
Good luck in business!

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question