반응형
https://django-allauth.readthedocs.io/en/latest/installation.html
1. all-auth 설치
- pip install django-allauth
2. settings.py > INSTALLED_APPS에 아래 추가
# The following apps are required:
'django.contrib.auth',
'django.contrib.messages',
'django.contrib.sites',
'allauth',
'allauth.account',
'allauth.socialaccount',
'allauth.socialaccount.providers.google',
3. settings.py에 아래 추가
AUTHENTICATION_BACKENDS = [
# Needed to login by username in Django admin, regardless of `allauth`
'django.contrib.auth.backends.ModelBackend',
# `allauth` specific authentication methods, such as login by e-mail
'allauth.account.auth_backends.AuthenticationBackend',
]
SITE_ID = 1
4. Email 확인을 위해 settings.py에 아래 추가
https://django-allauth.readthedocs.io/en/latest/configuration.html
ACCOUNT_EMAIL_REQUIRED = True
ACCOUNT_EMAIL_VERIFICATION = 'none'
5. url.py 에 url 추가하기
urlpatterns = [
...
path('accounts/', include('allauth.urls')),
...
]
6. migration 하기
python manage.py migrate
반응형
'Django' 카테고리의 다른 글
secret key 생성 (0) | 2022.03.07 |
---|---|
Markdownx 사용하기 (0) | 2022.02.24 |
Django-crispy-form을 설치하기 (0) | 2022.02.24 |
Python strip() (0) | 2022.02.24 |
Django Shell Plus (0) | 2022.02.22 |