allauth 2

Django allauth User 테이블과 Member 테이블 연결하기

카카오 소셜 로그인/회원가입을 allauth를 이용해 구현하면 자동으로 User 테이블이 생긴다.카카오에서 받아오는 정보가 해당 테이블에 등록되어서 단순히 카카오에서 받아오는 정보를 보여주기만 하면 되는 서비스의 경우에는 별도의 테이블을 생성할 필요 없이, 바로 User에 접근하여 데이터를 빼내오면 된다. 다만 우리 팀에서는 프로필 사진을 수정하는 기능이 존재하여 테이블의 데이터를 변경해야하는데, User 테이블의 데이터를 변경하기는 까다로워서 Member이라는 별도의 테이블을 만들고 둘을 연결했다. models.py에 아래 코드를 입력한다.from django.contrib.auth.models import Userfrom django.db import modelsclass Member(models.M..

Django로 카카오 소셜 로그인/회원가입 구현하기

1. allAuth 사용- 공식 문서를 참조하는 습관을 들이자.https://docs.allauth.org/en/latest/ django-allauthToggle Light / Dark / Auto color theme Toggle table of contents sidebardocs.allauth.org - 기초 설정은 여기서 볼 수 있다.https://docs.allauth.org/en/latest/installation/quickstart.html Quickstart - django-allauthToggle Light / Dark / Auto color theme Toggle table of contents sidebardocs.allauth.org (1) 패키지 설치 (프로젝트 가상 환경 터미..