본문 바로가기
내일배움캠프 AI 웹 프로그래밍

내일배움캠프 42일차 TIL_프로젝트 시작전, 뼈대만들기 [가상환경 설정/django 설치/pip list/freeze/startproject/gitignore/git init/ app install까지

by thriveview 2023. 10. 4.

쫄지말자

오 이제 좀 익숙해졌는데? 하지만 막상 또 하다가 오타, 혹은 작은 점 하나로 다시 시작하게되는 프로젝트 세팅 시간~ 

그냥 순서대로 적어두었다. 

이대로 복사붙여넣기해서 시간 단축하자 (내자신)

 

#새 폴더 만들기
python -m venv venv #가상환경 만들기 파일명을 'venv'로 설정
source venv/Scripts/activate #가상환경 실행
pip install django djangorestframework djangorestframework-simplejwt #django와 jwt를 설치
pip list #설치된 사항 확인
pip freeze > requirements.txt #여기까지 문제없다면 freeze해주기 
django-admin startproject drt_project . #현재폴더에 프로젝트 파일 만들기
#.git ignore 파일만들고 진행 보통 windos, visualstudiocode, python, django 만 추가해줘도 괜찮다
#git repositories 만들어주고 주소 복사
git init #git 생성해주기 
git remote add origin 'git주소 붙여넣기'
git add .
git commit -m 'init project'
git push origin main 
#다시 깃허브 들어가서 리프레시하고 파일 확인 
#setting.py>installed app> rest framework, simple jwt 추가 ➜ 이 2개 추가사항은 아래 스크린샷확인

#여기까지 만들어야 프로젝트 시작 가능

 

 

 

참고사이트 

https://django-rest-framework-simplejwt.readthedocs.io/en/latest/getting_started.html

 

Getting started — Simple JWT 5.2.2.post30+gfaf92e8 documentation

Cryptographic Dependencies (Optional) If you are planning on encoding or decoding tokens using certain digital signature algorithms (i.e. RSA and ECDSA; visit PyJWT for other algorithms), you will need to install the cryptography library. This can be insta

django-rest-framework-simplejwt.readthedocs.io

 

 

 

https://www.django-rest-framework.org/

 

Home - Django REST framework

 

www.django-rest-framework.org