Hello.
You need to register via facebook using the django-rest-framework . For this purpose, I use django-rest-auth and django-allauth . The documentation has the following instructions.
settings:
INSTALLED_APPS = ( ..., 'rest_framework', 'rest_framework.authtoken', 'rest_auth' ..., 'django.contrib.sites', 'allauth', 'allauth.account', 'rest_auth.registration', ..., 'allauth.socialaccount', 'allauth.socialaccount.providers.facebook', 'allauth.socialaccount.providers.twitter', ) views:
from allauth.socialaccount.providers.facebook.views import FacebookOAuth2Adapter from rest_auth.registration.views import SocialLoginView class FacebookLogin(SocialLoginView): adapter_class = FacebookOAuth2Adapter urls:
urlpatterns += [ ..., url(r'^rest-auth/facebook/$', FacebookLogin.as_view(), name='fb_login') ] The result is the following picture:
When I registered the application on Facebook I received App ID and App Secret .
But where to get this Acces token and Code ?
When I see similar buttons in someone's applications, the acces_token is in the link of the button itself, but I do not understand where it is generated.
Can anybody explain the mechanism, how does this whole thing work?
