[Django] Git & Github setting

Roel·2022년 1월 13일

장고 프로젝트를 git으로 관리할 수 있도록 초기화 진행

-git 초기화(manage.py 위치한 곳으로 이동 후)
git init

  • .gitignore
    gitignore.io 에서
    python, pycharm, VisualStudioCode, vim, macOS, Linux, zsh 후 결과 복사

cd '프로젝트 폴더명'
touch .gitignore
vi .gitignore

############################
gitignore.io 결과 전체 복사 #
############################

(가장 하단 my_settings.py 추가하기)
my_settings.py

  • add & commit
    git add .
    git commit -m "Add : Django Project Setting" (제목 넣기)
  • branch 생성
    git branch 브랜치 이름 # 브랜치 생성
    git checkout 브랜치 이름 # 해당 브랜치로 이동

  • 앱 생성
    python manage.py startapp 앱이름

  • 앱 이름 추가
    INSTALLED_APPS = [
    ...
    'products',
    ]

  • git add & commit
    git add .
    git commit -m "Add: products application"

  • git push
    git push origin "브랜치 이름"

profile
jhyunny

0개의 댓글