Search code examples
pythondjangopython-social-auth

cannot import name setting error while importing psa


I wanted mobile users to get google signin in my django application. And I followed this : https://stackoverflow.com/a/28946767

And got this error

File "/home/ghanshyam799/django_project_11/get_user_login/urls.py" in 3. from .views import *

File "/home/ghanshyam799/django_project_11/get_user_login/views.py" in 9. from social.apps.django_app.utils import psa

File "/usr/local/lib/python2.7/dist-packages/social/apps/django_app/utils.py" in 1. from social_django.utils import load_strategy, load_backend, psa, setting, BackendWrapper, strategy

Exception Type: ImportError at / Exception Value: cannot import name setting

How can I work around this? Thank you in advance


Solution

  • I think you should import psa like from social_django.utils import psa in your get_user_login/views.py file The package has been updated to change the package structure since the answer posted. Kindly check the updated documentation here http://python-social-auth-docs.readthedocs.io/en/latest/use_cases.html#signup-by-oauth-access-token