2025/06/03 6

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) 패키지 설치 (프로젝트 가상 환경 터미..

[Django] Table '프로젝트명.socialaccount_socialapp_sites' doesn't exist

- SocialApplication과 Site 사이의 다대다 관계를 저장하는 테이블이 DB에 생성되지 않음-> migrate를 하려고 하였으나 해당 테이블이 이미 존재한다는 에러 메시지를 전달받음 원인- mysql DB에 일부 테이블은 생성되어 있고, 일부 테이블이 누락된 상태- Django가 '그거 아마 없을 걸? 아니네? 있나? 아닌데, 없는... 있나?' 라며 혼란스러운 상황-> 완전히 초기화하자! 해결 방법(1) 테이블이 실제로 온전히 존재하는 지 확인- mysql에 접속해서 아래 코드를 입력mysql -u 사용자이름 -p# 비밀번호 입력USE schello;SHOW TABLES LIKE '%socialaccount%'; 테이블 목록에 아래 네 개는 꼭 나와야 정상임.socialaccount_..

에러 모음 2025.06.03

[Django] InconsistentMigrationHistory 에러

- 확인한 에러 코드InconsistentMigrationHistory: Migration socialaccount.0001_initial is applied before its dependency sites.0001_initial -> 연관되지 않은 마이그레이션 히스토리 : socialaccount 마이그레이션은 sites 앱에 의존-> 그러나 sites가 적용되기 전에 socialaccount가 먼저 마이그레이션-> 충돌 해결 방법(1) django_migrations 테이블에서 socialaccount 관련 레코드 삭제- mysql을 사용하는 관계로 아래 코드를 mysql에 접속해 입력한다.mysql -u 사용자이름 -p# 비밀번호 입력USE schello;DELETE FROM django_mig..

에러 모음 2025.06.03