1. Visual Studio Code 설치
https://code.visualstudio.com/download
Download Visual Studio Code - Mac, Linux, Windows
Visual Studio Code is free and available on your favorite platform - Linux, macOS, and Windows. Download Visual Studio Code to experience a redefined code editor, optimized for building and debugging modern web and cloud applications.
code.visualstudio.com
2. VS code 실행 후 extension 탭에서 python 설치

3. anaconda 설치
https://www.anaconda.com/download
Free Download | Anaconda
Anaconda's open-source Distribution is the easiest way to perform Python/R data science and machine learning on a single machine.
www.anaconda.com
4. flask 설치
아나콘다 프롬프트 열어보기
윈도우 아이콘-> 검색 -> Anaconda PowershellPrompt
프롬프트에서 가상환경 생성
conda create -n <가상환경 이름> python=<python 버전>
가상환경 활성화
conda activate <가상환경 이름>
프롬프트에서 pip install flask를 통해 flask 설치
pip install flask
5. Window Powershell
'관리자권한'으로 실행
Set-ExecutionPolicyUnrestricted

6. VS code에서 interpreter 선택
F1 키를 누른 후 interpreter 검색한 후 python: Select Interpreter 선택

방금 생성한 가상환경 선택
7. VS code에서 encoding 확인
설정에 들어간 후 encoding에서 UTF-8인지 확인


8. flask 실행
terminal 탭에서 new terminal 선택

command prompt 선택

터미널에서 flask run을 실행함 (flask 파일 이름은 app.py로 작성)

127.0.0.1:5000주소로접속해야함

'Back-end > Flask' 카테고리의 다른 글
[Flask] 버튼 클릭 시 화면 이동 (0) | 2024.03.25 |
---|---|
[Flask] 파이보 - 프로젝트 구조, 애플리케이션 팩토리, 블루프린트로 라우팅 함수 관리 (0) | 2023.12.30 |
[Flask] 애플리케이션 파일 생성, 플라스크 서버 실행 (0) | 2023.12.30 |