title: django rest auth facebook code for login
body: <p>On project I use django-rest-auth for user registration and authentication. Also i added code for facebook login:</p>
  
  <pre><code>from allauth.socialaccount.providers.facebook.views import FacebookOAuth2Adapter
  from rest_auth.registration.views import SocialLoginView
  
  class FacebookOAuth2AdapterFixed(FacebookOAuth2Adapter):
  
      def __init__(self):
          pass
  
  
  class FacebookLogin(SocialLoginView):
      adapter_class = FacebookOAuth2Adapter
  </code></pre>
  
  <p>And in my project urls.py I add </p>
  
  <pre><code>url(r'^rest-auth/facebook/$', FacebookLogin.as_view(), name='fb_login'),
  </code></pre>
  
  <p>But on url localhost:8000/rest-auth/facebook I see form with 2 parameters: Access token(already have) and code.
  <a href="https://i.stack.imgur.com/HwUmg.png" rel="noreferrer"><img src="https://i.stack.imgur.com/HwUmg.png" alt="enter image description here"></a>
   My question is next: Can I login via facebook without this code, and if not, how can I get this code without frontend? How can I check work user authentication/registration or not? 
  PS: SocialApp created, facebook app created, app id and app secret added to social app.</p>