Skip to content

cannot import name strategy #370

@lewang0418

Description

@lewang0418

Hi,

I am trying the following code,

@strategy()
def register_by_access_token(request, backend):
backend = request.strategy.backend
try:
user = request.user
user = backend._do_auth(
access_token = request.GET.get('access_token'),
user = user.is_authenticated() and user or None
)
except Exception as err:
print "User is None", err
if user and user.is_active:
return user
else:
return None

However, when I try to include strategy by writing down "from social.apps.django_app.utils import strategy", I get "cannot import name strategy" error. After looking into the souce code of social/apps/django_app/utils.py, I could not find "strategy". Am I using a wrong version or where did I do wrong?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions