전체 글
-
팀프로젝트 Github 트러블슈팅Git 2024. 9. 18. 02:40
Github 트러블슈팅 01. 만들었던 브랜치에 코드를 수정한 후 git add . → git commit -m "로그인 중복 로직 수정" 하고, git push 를 하는데, 처음 만든 브랜치가 아닌데 왜 자꾸 업스트림 브랜치랑 다르다는거야.. 아무튼 자꾸 이런 메시지가 뜬다🧐 음... 그래서 그냥 다시 이렇게 해줬다. -ugit push -u origin 내 브랜치 네임 그런 다음 다시 git push 했더니 제대로 됐다. 뭘까?..🤔 아무튼 문제 해결👌 02. 로그인 할 때마다 포인트를 주는 기능을 구현했는데.. 영환님이 유저가 로그인 로그아웃 로그인 로그아웃 로그인 계속 반복하면 포인트 무한대로 받을 수 있겠네요 라고 했다😂 그렇게까지 시간낭비를 하는 사람이 있을까 싶었지만, 악용되..
-
[Django] 뉴스 API 서버 구현 중, 트러블 슈팅Django 2024. 9. 14. 03:04
트러블 슈팅 01. 비밀번호 변경 기능 구현 후 Postman에서 테스트를 하는데 에러가 났다. 왜 안되지.. dict를 불러올 수 없다구??🤔 views.py 코드를 보면 뭐가 문제일까..old_password와 new_password를 튜플로 묶어줘서 그런건가.. 리스트로 묶어주면?해결된다! 근데.. 비밀번호를 1로 바꿔도 변경이 된다..🫠 구글에 파이썬 비밀번호 검증 정규표현식으로 검색했더니 여러가지가 정보가 쏟아졌다. 그 중 하나를 참고해 validators.py 에 로직을 추가해줬다. def changepasswordValidation(pwd): if len(pwd) /?]+', pwd) is None: # 비밀번호는 최소 1개 이상의 특수문자가 포함되어야 함 ..
-
LangChain 과 RAGLLM 2024. 9. 13. 09:16
LangChain이란? LangChain은 대규모 언어 모델(LLM)을 활용한 애플리케이션 개발을 위한 프레임워크로, AI 모델의 능력을 극대화하고, 개발 과정을 간소화하여 강력하고 유연한 AI 애플리케이션을 만들 수 있게 해준다. 📌 AI 어플리케이션 프레임워크 랭체인 : python 웹 프레임워크 장고 LangChain 의 장점 모듈성: LangChain은 다양한 컴포넌트를 제공하여 개발자가 필요에 따라 조합하고 커스터마이즈 가능LLM Loader VectorStoreOpenAI Anthropic Google Local통합성: 다양한 AI 모델, 데이터 소스, 그리고 외부 도구들과의 쉬운 통합을 지원효율성: 복잡한 AI 로직을 간단한 체인으로 구현할 수 있어 개발 시간과 비용을 절감확장성: 소..
-
팀프로젝트 협업툴 GithubGit 2024. 9. 12. 18:42
팀프로젝트 협업툴 Github 실수로 git add . 까지 했는데 취소하고 싶을 때git reset 커밋 되돌리기 최근 커밋 되돌리기git revert 모든 커밋 되돌리기# 특정 커밋으로 되돌리기git reset --hard # 원격 저장소 강제 업데이트git push --force ✋ 주의: 강제로 푸시하는 것은 다른 팀원에게 영향을 줄 수 있으니 주의가 필요하다. 반드시 이야기하고 해야함. 커밋을 잘못 리셋한 경우, 이전 상태로 복원하고 싶을 때git refloggit reset --hard HEAD@{0} *HEAD@{0} 괄호 안의 숫자가 0 이면 가장 최근 커밋을 뜻하는거다. 최신 commit을 취소하고 작업 내용을 수정하거나 저장하고 싶을 때 최신 커밋과 관련된 모든 변경 사항을..
-
Django DRF 개인과제 트러블 슈팅Django 2024. 9. 10. 17:21
Django DRF 트러블 슈팅 1.1 발단 및 전개 로그아웃 기능 코드를 구현하고 테스트를 하는 과정에서 에러가 발생했다. except InvalidToken 으로 예외처리를 해줬는데 왜그럴까? 🤔 or 로 발견된 예외코드를 추가해줬다. except InvalidToken or TokenError: 1. 2 위기 및 해결 수정 후 다시 테스트를 했는데 여전히 에러가 났다.할 수 없이 구글링 하다, gpt에 물어보니 이런 경우에는 튜플로 처리를 해줘야 한다고 한다. 다시 테스트 해본 결과 잘 해결되었다. 하지만 간결하게 코드를 작성하고 싶어서 또다시 구글링 하다보니 TokenError가 InvalidToken을 포함하는 범용적인 에러이기 때문에 TokenError만을 사용하여 예외를 ..
-
[Django] API 문서화Django 2024. 9. 10. 03:32
API 문서화 API 문서의 경우, 사실 회사마다 다르고 개발팀마다 사용하는 방법이 다르다. 각 회사마다 다르고 팀마다 다르고 사용하는 툴도. 형식도 다르다. 로마에 가면 로마의 법을 따르듯, 문서도 아마 조직에 맞는 형식을 따르게 될 거다. 대표적으로 가장 많이 쓰이는 문서 형식들을 살펴보자. 노션(Notion)IT 업계에서 소통을 위한 도구로 많이 사용하는 도구다.검색, 필터, 정렬등 데이터를 편하게 작성하고 볼 수 있는 기능을 제공한다.https://teamsparta.notion.site/659a433196e84d619cbdaa2121efacfe?v=fd64cd963d064df1913fef419a50cf7a&pvs=4 포스트맨(Postman)Postman과 함께 제공되는 경우가 일반적이므로 ..
-
[Django] AWS 배포 → Gunicorn, Nginx 설치 및 설정Django 2024. 9. 8. 21:03
Django, AWS 배포 (Deploy) 이어서... gunicorn 설치 및 설정하기 설치과정에서 나오는 설정들은 tab해서 모두 OK로 설치하면 된다.$ sudo apt-get update$ sudo apt-get install gunicorn Gunicorn 실행 manage.py가 있는 프로젝트 폴더에서 실행해준다.gunicorn --bind 0:8000 api_pjt.wsgi:application다시 웹브라우저로 들어가봐도 잘 동작하는 것을 볼 수 있다. 그런데 /admin/ 으로 들어가면?정적 파일이 제공되지 않고 있지 않기 때문이다 → Nginx에서 처리 예정 정적 파일 다루기 정적파일 설정 및 한 곳으로 모으기 settings.py에 static 파일들이 위치할 경로와 url을..
-
Django, AWS 배포 (Deploy)Django 2024. 9. 6. 04:41
Django, AWS 배포 (Deploy) 지금까지는 테스트서버에서만 확인해본거니까 이제 배포를 해보자👀 AWS 계정 생성 (https://aws.amazon.com/ko/) 기본적으로 여러 자원에 대해 프리티어를 제공하여 정해진 사용량까지 무료로 체험 가능하다. (가입부터 해야함)이후로는 자동으로 과금이 들어가기 때문에 사용하지 않을거라면 자원을 해지해야 한다. 가입시 해외 결제가 가능한 카드 필요하다.(체크 or 신용), 100원의 테스트 결제 후 바로 취소된다.어려운 건 1도 없는데 주소 입력하고 카드번호 입력하고... 너무 귀찮..드디어 성공😊 → AWS Management Console로 이동 AWS EC2 인스턴스 생성 국가 서을로 바꿔주기 검색에 ec2 적고 ★..