| 1 |
VK |
| 2 |
-- |
| 3 |
|
| 4 |
App registration |
| 5 |
https://vk.com/editapp?act=create |
| 6 |
|
| 7 |
Development callback URL ("Site address") |
| 8 |
http://localhost |
| 9 |
https://localhost |
| 10 |
|
| 11 |
Note: You have to use ports 80 or 443 to test VK locally, VK doesn't |
| 12 |
support other ports for now |
| 13 |
|
| 14 |
|
| 15 |
Django configuration |
| 16 |
******************** |
| 17 |
|
| 18 |
Use the following settings example to login via VK (full name - VK ID). |
| 19 |
|
| 20 |
.. code-block:: python |
| 21 |
|
| 22 |
SOCIALACCOUNT_PROVIDERS = { |
| 23 |
'vk': { |
| 24 |
"APPS": [ |
| 25 |
{ |
| 26 |
"client_id": "YOUR_CLIENT_ID", |
| 27 |
"secret": "YOUR_CLIENT_SECRET", |
| 28 |
"key": "", |
| 29 |
}, |
| 30 |
], |
| 31 |
'SCOPE': [ |
| 32 |
'email', |
| 33 |
], |
| 34 |
} |
| 35 |
} |
| 36 |
|
| 37 |
|
| 38 |
Don't forget to add VK provider into Django installed apps: |
| 39 |
|
| 40 |
.. code-block:: python |
| 41 |
|
| 42 |
INSTALLED_APPS = [ |
| 43 |
... |
| 44 |
'allauth.socialaccount.providers.vk', |
| 45 |
... |
| 46 |
] |