使用angular JS和Django的Facebook身份验证

使用angular JS和Django的Facebook身份验证,django,django-rest-framework,python-social-auth,Django,Django Rest Framework,Python Social Auth,我是angular JS和django的初学者。我是按照这个教程制作facebook认证应用程序的 我完全遵循了教程。当我启动服务器时,我得到了一个错误 NameError at / name 'strategy' is not defined Request Method: GET Request URL: http://127.0.0.1:8000/ Django Version: 1.3.1 Exception Type: NameError Except

我是angular JS和django的初学者。我是按照这个教程制作facebook认证应用程序的

我完全遵循了教程。当我启动服务器时,我得到了一个错误

NameError at /

name 'strategy' is not defined

Request Method:     GET
Request URL:    http://127.0.0.1:8000/
Django Version:     1.3.1
Exception Type:     NameError
Exception Value:    

name 'strategy' is not defined

Exception Location:     /root/Documents/django/clueless/clueless_engine/../clueless_engine/views.py in <module>, line 1
Python Executable:  /root/Documents/django/clueless/bin/python
Python Version:     2.7.13
Python Path:    

['/root/Documents/django/clueless/clueless_engine',
 '/root/Documents/django/clueless/lib/python2.7',
 '/root/Documents/django/clueless/lib/python2.7/plat-x86_64-linux-gnu',
 '/root/Documents/django/clueless/lib/python2.7/lib-tk',
 '/root/Documents/django/clueless/lib/python2.7/lib-old',
 '/root/Documents/django/clueless/lib/python2.7/lib-dynload',
 '/usr/lib/python2.7',
 '/usr/lib/python2.7/plat-x86_64-linux-gnu',
 '/usr/lib/python2.7/lib-tk',
 '/root/Documents/django/clueless/local/lib/python2.7/site-packages',
 '/root/Documents/django/clueless/lib/python2.7/site-packages']

Server time:    Thu, 1 Jun 2017 07:30:14 +0530

我已经使用python scocial Auth创建了社交身份验证。您可以检查:

职位:


问题是我忘了导入模块

from social.apps.django_app.utils import load_strategy strategy = load_strategy(request) 

非常感谢。但是你能找到导致这个错误的原因吗?我想你需要像这样导入模块:from social.apps.django\u app.utils import load\u strategy=load\u strategyrequest我真不敢相信我错过了!!
Content-Type : application/json

{ "accessToken": "alert token" }
from social.apps.django_app.utils import load_strategy strategy = load_strategy(request)