pip install django-allauth python INSTALLED_APPS = [ ... 'allauth', 'allauth.account', 'allauth.socialaccount', ... ] AUTHENTICATION_BACKENDS = [ ... 'allauth.account.auth_backends.AuthenticationBackend', ... ] SITE_ID = 1 python SOCIALACCOUNT_PROVIDERS = { 'github': { 'APP': { 'client_id': 'YOUR_CLIENT_ID', 'secret': 'YOUR_SECRET_KEY', 'key': '' } } } AUTHENTICATION_BACKENDS = [ ... 'allauth.socialaccount.providers.github', ... ] python from django.urls import include, path urlpatterns = [ ... path('accounts/', include('allauth.urls')), ... ] python manage.py migrate allauth python manage.py runserver


上一篇:
下一篇:
切换中文