E
E
Evgeny Stavitsky2016-03-04 03:05:08
Django
Evgeny Stavitsky, 2016-03-04 03:05:08

Get access_token vkontakte (python-social-auth)?

Using python-social-auth, user login on the site. For further work with api, it is necessary to receive an access_token, how to do this?
At the moment, the view code is:

import vk
from django.http import HttpResponse
from django.shortcuts import render

def home(request):
    session = vk.Session()
    api = vk.API(session)
    posts = api.newsfeed.get()
    return render(request, 'home.html', {'posts':posts})

I would be very grateful for an example implementation!

Answer the question

In order to leave comments, you need to log in

6 answer(s)
R
Roman Kitaev, 2016-03-04
@deliro

The token is stored in this model:
AbstractUserSocialAuth.extra_data

D
Dmitry Voronkov, 2016-03-04
@DmitryVoronkov

Why python socail auth and not django-social-auth

U
ukoHka, 2014-12-10
@ukoHka

Such an effect?

I
Igor Pavlenko, 2014-12-10
@MrSteep

Hold on, I hope you are able to bring it to the form that you require)

M
Mikhail Lyalin, 2014-12-10
@mr_jok

look for a module to issue an Alt-description

I
Ivan-P, 2014-12-10
@Ivan-P

Try it with figure and figcaption with z-index less than 1.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question