2

I am a new web developer using the Django framework and I try to set multiple scopes for social_auth_facebook_scope in the Django framework.

What I have done is ref from this link: How can I ask for different permissions from facebook at different times?

But I didn't know how to do it so

First,I put the FACEBOOK_SCOPE and FACEBOOK_CUSTOM_SCOPE in the setting.py file

SOCIAL_AUTH_FACEBOOK_SCOPE = ['email', 'user_link']
SOCIAL_AUTH_FACEBOOK_CUSTOM_SCOPE = ['instragram_basic']

Second, I don't know where to put this code in.

class CustomFacebookOAuth2(FacebookOAuth2) :
  name = 'facebook-custom'

Is it have to use in views.py or apps.py, I don't have any ideas.

Next, I want my 2 buttons to separate each request

  • First button is to log in with Facebook only
  • Second button is to request permission for an Instagram business account so how do I config in my HTML file

Now what I am config is set the URL to call Facebook-custom to request different scope but it doesn't work and return Error pages not found

http://localhost:8000/social-auth/login/facebook-custom/

Instagram business Account HTML

class="nav-link" href="{% url 'social:begin' 'facebook-custom' %}">Instragram business account

How can I fix it, Anyone has an idea.

Murat Demir
  • 716
  • 7
  • 26

0 Answers0