Can't Load URL Error on Facebook Login Integration: Missing 'Facebook Login' Product in Developer Console
Question: I'm integrating Facebook Login into my Django web application hosted at https://weddingcloset.store. In the Facebook Developer Console, I set up an app and added weddingcloset.store and www.weddingcloset.store to the App Domains in the Basic settings. I also added the Privacy Policy URL and Site URLbasic settings.Dashboard error message. Additionally, in my Facebook Developer Console, the "Add Product" option, which includes Facebook Login, does not appear in the sidebar. I cannot find the OAuth Redirect URI field either, making it impossible to specify the redirect path.
This is code of my setting.py , I am using django
# settings.py
from pathlib import Path
BASE_DIR = Path(__file__).resolve().parent.parent
SECRET_KEY = 'django-insecure-x(m$y#9=ko8*q(z8@=0ct%8v6sppw(+9!^mt$tt^926%!0%shf'
DEBUG = True
ALLOWED_HOSTS = []
INSTALLED_APPS = [
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'social_django',
'login_via_facebook',
]
MIDDLEWARE = [
'django.middleware.security.SecurityMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.common.CommonMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
'django.middleware.clickjacking.XFrameOptionsMiddleware',
'social_django.middleware.SocialAuthExceptionMiddleware',
]
ROOT_URLCONF = 'social_logins.urls'
TEMPLATES = [
{
'BACKEND': 'django.template.backends.django.DjangoTemplates',
'DIRS': ['templates'],
'APP_DIRS': True,
'OPTIONS': {
'context_processors': [
'django.template.context_processors.debug',
'django.template.context_processors.request',
'django.contrib.auth.context_processors.auth',
'django.contrib.messages.context_processors.messages',
'social_django.context_processors.backends', # Fixed typo here
],
},
},
]
WSGI_APPLICATION = 'social_logins.wsgi.application'
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': BASE_DIR / 'db.sqlite3',
}
}
AUTH_PASSWORD_VALIDATORS = [
{
'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator',
},
{
'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator',
},
{
'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator',
},
{
'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator',
},
]
LANGUAGE_CODE = 'en-us'
TIME_ZONE = 'UTC'
USE_I18N = True
USE_TZ = True
STATIC_URL = 'static/'
DEFAULT_AUTO_FIELD = 'django.db.models.BigAutoField'
# Social app custom settings
AUTHENTICATION_BACKENDS = [
'social_core.backends.facebook.FacebookOAuth2', # Fixed typo here
'django.contrib.auth.backends.ModelBackend',
]
LOGIN_URL = 'login' # Specify the login view URL name
LOGOUT_URL = 'logout' # Specify the logout view URL name
LOGIN_REDIRECT_URL = 'home' # Redirect after successful login
LOGOUT_REDIRECT_URL = 'login' # Redirect after logout
# Add your Facebook app credentials here
SOCIAL_AUTH_FACEBOOK_KEY = ""
SOCIAL_AUTH_FACEBOOK_SECRET = ""
# To request the user's email during Facebook login
SOCIAL_AUTH_FACEBOOK_SCOPE = ['email']