pip install django-allauth
python
INSTALLED_APPS = [
...
'allauth',
'allauth.account',
'allauth.socialaccount',
...
]
python
AUTHENTICATION_BACKENDS = [
...
'allauth.account.auth_backends.AuthenticationBackend',
...
]
python
from django.urls import include
urlpatterns = [
...
path('accounts/', include('allauth.urls')),
...
]
python manage.py migrate
python
AUTHENTICATION_BACKENDS = [
...
'allauth.account.auth_backends.AuthenticationBackend',
...
]
python
python
python
python
python
python
from django.contrib.auth.models import Group
python
from django.contrib.auth.models import Permission
python
from django.contrib.auth.decorators import permission_required
def my_view(request):
...