Now let’s add some logins crucial to Post-Soviet countries – VK (vk.com) and Google (cause we are either okay with our governments reading our emails or paranoiac af).
VK (/dev)

Credentials
- Go to My Apps and press Create App. For local testing, to be safe, say choose localhost:8000 instead of 127.0.0.1:8000 – it was crucial for FaceBook Login (proof 1 and proof 2).

Settings
2. There are three lines of generated code, but you only need two. So, App

App ID -> Client
id
and Secure Key -> Secret Key
.
If you decide to set things up in settings.py, then it’s pretty much the same:
SOCIALACCOUNT_PROVIDERS = {
'vk': {
'APP': {
'client_id': 'App ID',
'secret': 'Secure Key',
'key': ''
}
},
3. Don’t forget to add to INSTALLED_APPS:
INSTALLED_APPS = [
# ...
'allauth.socialaccount.providers.vk',
# ...
]
4. Then go and do the same thing I showed in Facebook Login. Just leave method
parameter out:
<p><a href="{% provider_login_url "vk"%}" target="blank">VK login</a></p>
Errors
VK login invalid request, application was deleted

Something must be wrong with the credentials. Go to Settings and see you put things in right places.
Google (dev)
Credentials
- Go to Google APIs page and press Create Project

2. Then go to OAuth settings, open it for everyone and fill in App Name.

3. Then scroll down and instead of localhost:8000 (Google does not allow it), use https://tolocalhost.com/. You need to Enable redirecting and set your Port.

4. Then go to Credentials. Choose Web App (or Website)

5. Then Create and you’ll have your credentials to add to settings. Press OK.

6. Set URI and redirect:
http://localhost:8000
http://localhost:8000/accounts/google/login/callback
http://127.0.0.1:8000/accounts/google/login/callback

Settings
7. Go to settings.py and add:
SOCIALACCOUNT_PROVIDERS = {
'google': {
'APP': {
'client_id': 'ClientID', # first line
'secret': 'SecretKey', # second line
'key': ''
}
},
}
8. Don’t forget to add to INSTALLED_APPS:
INSTALLED_APPS = [
# ...
'allauth.socialaccount.providers.google',
# ...
]
Or go to /admin/socialaccount/socialapp/add/
and add a Google SocialApp
instance:

9. Then go and do the same thing I showed in Facebook Login. Just leave method
parameter out:
<p><a href="{% provider_login_url "vk"%}" target="blank">VK login</a></p>
[…] wrote about it previously, so please go check out pieces for Facebook and Google. Some things change all the time, but the main points still […]
LikeLike