1.[drf] 프로젝트 시작하기

초기 셋팅

간단 버전

mkdir foldername
cd foldername
pip install virtualenv
virtualenv env
cd env/Script/
./activate
pip install django
django-admin startproject 프로젝트명
python manage.py startapp 앱명
python manage.py runserver

보너스 깃설치

  • 해당 폴더 cmd
npx gitignore python
git init
git remote add origin (깃주소)
git remote -v

PIP

pip install boto3 django-cors-headers django-dotenv django-filter django-storages django-restframework djangorestframework-simplejwt gunicorn whitenoise psycopg2 dj-database-url

django-autoslug
django-countries (모델에서 국가를 선택해야할 때 CountryField())
django-phonenumber-field (모델에서 폰번호 추가할 때 PhoneNumberField())
phonenumbers
drf-yasg
Pillow (장고 이미지 라이브러리)
argon2-cffi (패스워드 해싱)
pytz (타임존)
black (파이썬 코드 포매터)
isort (파이썬 임포트 알파벳순으로 정렬)
pip install pip_chill
pip-chill

로컬-프로덕션 나누는 폴더 구성

settings  - __init__.py
                    - base.py
                    - local.py
                    - production.py

requirements - base.txt
                         - local.txt
                         - production.txt