<TIL - 0028> DRF 시작하기

개발일지·2023년 4월 25일
0

til

목록 보기
28/43


DRF (djangorestframework) 세팅

python -m venv venv (python3 -m venv venv)
source venv/Scripts/activate (source/venv/bin/activate)
pip list (pip3 list)
pip install django
pip install djangorestframework djangorestframework-simplejwt
pip freeze > requirements.txt (pip install -r requirements.txt)
django-admin startproject PROJECTNAME .
.gitignore 생성 : gitignore.io (Windows,macOS,Python,Django,VisualStudioCode)
git init
git add .
git commit -m "init project"
git branch -M main
git remote add origin git@github.com:~~
git push origin main

#settings.py

INSTALLED_APPS = [
	...
	'rest_framework',
	'rest_framework_simplejwt',
	...
]

...

LANGUAGE_CODE = 'ko-kr'

TIME_ZONE = 'Asia/Seoul'

python manage.py runserver



profile
아닐지

0개의 댓글