[window + poetry] 윈도우에서 Poetry를 이용해 서버실행하기

2022. 9. 14. 18:40
반응형

https://python-poetry.org/docs/#installation

 

Introduction | Documentation | Poetry - Python dependency management and packaging made easy

If you installed using the deprecated get-poetry.py script, you should use it to uninstall instead: curl -sSL https://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py | python3 - --uninstall

python-poetry.org

 

 

 

1. 윈도우 파워쉘에서 아래 명령어 입력

(Invoke-WebRequest -Uri https://install.python-poetry.org -UseBasicParsing).Content | py -

 

 

 

 

2. 윈도우는 환경변수 설정을 따로 해주어야 한다. 안하고 그냥 쓰려고 하면 poetry 명령어를 찾을 수 없다는 에러가 난다.

 

제어판 > 시스템 > 고급 시스템 설정 > 환경변수 > 

 

 

 

 

 

3. Path에 아래 경로 추가 (사용자변수와 시스템변수 둘 다에 설정해주었다)

 

%APPDATA%\Python\Scripts

 

 

 

 

4. poetry --version 이라고 입력해서 제대로 설치되었는지, 어디에서든지 사용할 수 있게 되었는지 확인!

(만약 확인이 제대로 안된다면 shell이나 터미널을 껐다 켜보기)

 

 

 

5. 가상환경을 설치하고자 하는 폴더로 이동해서 poetry install 명령어 입력

//폴더 이동
cd server

//패키지 설치
poetry install

 

 

6. 패키지 설치가 다 되었으면 가상환경 실행 후, 마이그레이션 및 런 서버

//가상환경 실행
poetry shell


//마이그레이션
python manage.py migrate


//서버실행
python manage.py runserver

 

 

 

반응형

BELATED ARTICLES

more