我有一个应用程序,它有一个客户端 ID some_client_id
,用户通过 Facebook oauth 进行身份验证。返回的令牌(代码)是some_token_to_auth_the_user
.
我的后端是django rest framework
, 和rest_auth
.
现在我正在尝试使用facebook code (token)
在网址上http://localhost.com:8000/rest-auth/facebook/
输入表格的凭据是什么?
是client-id
吗facebook-token
?
我尝试了两者,
输出是,
TypeError at /rest-auth/facebook/
__init__() takes exactly 2 arguments (1 given)
Request Method: POST
Request URL: http://localhost.com:8000/rest-auth/facebook/
Django Version: 1.9.6
Exception Type: TypeError
Exception Value:
__init__() takes exactly 2 arguments (1 given)
Exception Location: /home/xo/.virtualenvs/dj19/local/lib/python2.7/site-packages/rest_auth/registration/serializers.py in validate, line 63
Python Executable: /home/xo/.virtualenvs/dj19/bin/python
Python Version: 2.7.10
这些是观点,
from allauth.socialaccount.providers.facebook.views import FacebookOAuth2Adapter
from rest_auth.registration.views import SocialLoginView
from allauth.socialaccount.providers.twitter.views import TwitterOAuthAdapter
from rest_auth.views import LoginView
from rest_auth.social_serializers import TwitterLoginSerializer
class FacebookLogin(SocialLoginView):
adapter_class = FacebookOAuth2Adapter
class TwitterLogin(LoginView):
serializer_class = TwitterLoginSerializer
adapter_class = TwitterOAuthAdapter
我究竟做错了什么?感谢您的任何帮助。