본문 바로가기

전체 글30

카카오 소셜 로그인 프로젝트에서 소셜 로그인 기능을 만들어 달라는 요청을 받았다. 찾아보니 백엔드에서만 처리 할 수 있는 문제는 아니고 프론트와 같이 작업을 해야만 했다. 그래서 문서를 만들어서 공유 할 겸 블로그로 적어본다. 현재 스택은 React와 Django를 사용하고 있습니다. 우선 키 발급 부터 포스트를 하겠습니다. 우선 아래 사이트에서 애플리케이션을 추가해 주어야 합니다. https://developers.kakao.com/docs/latest/ko/getting-started/app#platform Kakao Developers 카카오 API를 활용하여 다양한 어플리케이션을 개발해보세요. 카카오 로그인, 메시지 보내기, 친구 API, 인공지능 API 등을 제공합니다. developers.kakao.com 저장을.. 2023. 7. 5.
testcode 작성시 참조된 값을 가지고 오고 싶을 때 테스트 코드를 작성하다가 data = { "name": "Blasssbla", "description": "blabla", "logo": "img", "category": { "name": "Baling", "imgpath": "img" }, "contacts": [ { "status": 1 } ], "branches": [ { "latitude": "2131ssss2321", "longitude": "12321321", "address": "Osssssh" } 위 코드처럼 참조된 값을 가져와야 할 수도 있다. 하지만 출력을 해 보면 object(1) 이런 식으로 나오는 것을 볼 수 있다. 이떻게 해결할까? 간단하다. self.client.post(self.course_url, data, format=".. 2023. 7. 4.
협업을 위한 기초 git 사용법. $ git branch # (현재 브랜치 목록을 알 수 있습니다.) $ git branch branchname # (branchname라는 브랜치 생성) $ git checkout branchname # (작업 브랜치를 변경합니다.) $ git branch -d branchname # (브랜치를 삭제합니다) $ git checkout -b branchname # branchname를 생성하고 이동합니다. (동시에 하고 싶으면 -b를 붙이세요! git branch name이 노력을 아껴줍니다) $ git status # 여기서는 충돌난 파일을 알려줍니다 작업 전에는 꼭 git pull origin main pull을 받고 해 주세요. (혹시 모르니까) 사용법. $ git checkout -b branchn.. 2023. 7. 4.
배포된 웹 사이트 새로운 모델 필드 추가하기 지난번 모델을 수정하면서 몇가지 문제점이 드러났다. class Question(CommonModel): description = models.TextField() class Meta: abstract = True # 공용 질문 class Questions(Question): authon = models.ForeignKey( "users.User", on_delete=models.CASCADE, ) count = models.PositiveIntegerField(default=1) # 개인 질문 모음 class SellectedQuestions(Question): user = models.ForeignKey( "users.User", on_delete=models.CASCADE, ) importance =.. 2023. 6. 19.