파이썬 패키지, Fastapi 초기 프로젝트 세팅 명령어
- PyPI에 배포할 패키지
- 의존성 관리가 중요한 프로젝트
- 표준적인 파이썬 프로젝트 구조
1
2
3
poetry new my-project
# 또는 기존 디렉토리에서
poetry init
- REST API, 웹 서비스
- 자동으로 FastAPI 보일러플레이트 생성
- uvicorn 설정까지 포함
1
fastapi-cli create
- 파이썬뿐만 아니라 모든 언어/프레임워크 지원
- GitHub에 있는 템플릿을 가져와서 프로젝트 생성
- 사용자 입력을 받아서 동적으로 파일 생성
1
2
3
4
5
6
7
8
9
10
11
# 파이썬 패키지
cookiecutter https://github.com/audreyfeldroy/cookiecutter-pypackage
# Django 프로젝트
cookiecutter https://github.com/cookiecutter/cookiecutter-django
# FastAPI 프로젝트
cookiecutter https://github.com/tiangolo/full-stack-fastapi-postgresql
# React 앱도 가능
cookiecutter https://github.com/Seedstars/cookiecutter-react
#초기세팅, #poetry, #fastapi_cli, #cookiecutter
이 기사는 저작권자의 CC BY 4.0 라이센스를 따릅니다.