导入psa时无法导入名称设置错误
cannot import name setting error while importing psa
我希望移动用户在我的 Django 应用程序中获得 google 登录。我跟着这个:
得到这个错误
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
我该如何解决这个问题?
提前谢谢你
我认为你应该在 get_user_login/views.py
文件中像 from social_django.utils import psa
一样导入 psa
自发布答案以来,该包已更新以更改包结构。请在此处查看更新的文档 http://python-social-auth-docs.readthedocs.io/en/latest/use_cases.html#signup-by-oauth-access-token
我希望移动用户在我的 Django 应用程序中获得 google 登录。我跟着这个:
得到这个错误
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
我该如何解决这个问题? 提前谢谢你
我认为你应该在 get_user_login/views.py
文件中像 from social_django.utils import psa
一样导入 psa
自发布答案以来,该包已更新以更改包结构。请在此处查看更新的文档 http://python-social-auth-docs.readthedocs.io/en/latest/use_cases.html#signup-by-oauth-access-token