Social-auth-app-django facebook authentication url blocked
Мой settings.py содержит следующее :
LOGIN_URL = 'login'
LOGOUT_URL = 'logout'
LOGIN_REDIRECT_URL = 'home'
LOGOUT_REDIRECT_URL = 'login'
SOCIAL_AUTH_URL_NAMESPACE = 'social'
AUTHENTICATION_BACKENDS = [
'social_core.backends.facebook.FacebookOAuth2',
'social_core.backends.instagram.InstagramOAuth2',
'social_core.backends.linkedin.LinkedinOAuth2',
'social_core.backends.google.GoogleOAuth2',
'social_core.backends.google.GoogleOAuth',
'django.contrib.auth.backends.ModelBackend',
]
SOCIAL_AUTH_PIPELINE = [
'social_core.pipeline.social_auth.social_details',
'social_core.pipeline.social_auth.social_uid',
'social_core.pipeline.social_auth.social_user',
'social_core.pipeline.user.get_username',
'social_core.pipeline.social_auth.associate_by_email',
'social_core.pipeline.user.create_user',
'social_core.pipeline.social_auth.associate_user',
'social_core.pipeline.social_auth.load_extra_data',
'social_core.pipeline.user.user_details',
'social_core.pipeline.social_auth.auth_allowed',
]
SOCIAL_AUTH_FACEBOOK_KEY = "..."
SOCIAL_AUTH_FACEBOOK_SECRET = "..."
INSTALLED_APPS = [
"django.contrib.admin",
"django.contrib.auth",
"django.contrib.contenttypes",
"django.contrib.sessions",
"django.contrib.messages",
"django.contrib.staticfiles",
'rest_framework',
'rest_framework.authtoken',
"core",
'social_django',
'sslserver',
]
STATIC_URL = '/static/'
STATIC_ROOT = os.path.join(BASE_DIR, 'staticfiles')
STATICFILES_DIRS = (os.path.join(BASE_DIR, 'static'),)
myapp.urls.py:
urlpatterns = [
path("admin/", admin.site.urls),
path('', include('core.urls')),
path('social-auth/', include('social_django.urls', namespace="social")),
]
core.urls.py
urlpatterns = [
path("", views.title, name="title"),
path("home", views.home, name="home"),
path("login", views.login, name="login"),
path('logout', views.logout, name='logout'),
]
core.views.py
def title(request):
return render(request, 'title.html')
def login(request):
return render(request, 'login.html')
@login_required
def home(request):
return render(request, 'home.html')
@login_required
def logout(request):
try:
del request.session['uid']
except:
pass
auth.logout(request)
return redirect('login')
templates.registration.login.html
<button class="btn btn-primary mb-2">
<a href="{% url 'social:begin' 'facebook' %}">Login with Facebook</a>
</button>
Я добавил полный сайт локалхоста
Я добавил url для редактирования
Но все равно я получаю ошибку заблокированного url при нажатии на кнопку "Войти с помощью facebook"
Я искал везде в интернете и не смог найти проблему. Есть идеи, пожалуйста?