0
我有一個應用程序,其中有一個客戶端ID some_client_id
用戶通過Facebook oauth進行身份驗證。返回的令牌(代碼)是some_token_to_auth_the_user
。用appid和訪問令牌驗證django rest框架?
我的後端是django rest framework
和rest_auth
。
我現在想對URL http://localhost.com:8000/rest-auth/facebook/
哪些憑證輸入驗證形式與facebook code (token)
用戶?
是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
我究竟做錯了什麼?感謝您的任何幫助。