File tree Expand file tree Collapse file tree 3 files changed +36
-0
lines changed
Expand file tree Collapse file tree 3 files changed +36
-0
lines changed Original file line number Diff line number Diff line change 1+ # Dependencies
2+
3+ You will need all of the following dependencies to run this example:
4+
5+ - Python virtual environment
6+
7+ ## Python Virtual Environment
8+
9+ - Move to the fast-api folder
10+ - ` cd <web/fastapi/hello_world> `
11+ - Create a virtual environment
12+ - On Mac: ` python3 -m venv .venv `
13+ - On Windows: ` python -m venv .venv `
14+ - Activate the virtual environment
15+ - On Mac: ` source .venv/bin/activate `
16+ - On Windows: ` .venv\Scripts\activate `
17+ - Install dependencies
18+ - On Mac: ` pip3 install -r requirements.txt `
19+ - On Windows: ` pip install -r requirements.txt `
20+ - Call a specific script
21+ - On Mac: ` python3 <script_name>.py `
22+ - On Windows: ` python <script_name>.py `
23+ - Deactivate virtual environment
24+ - ` deactivate `
25+
26+ # Run the code
27+ Mac ` ./.venv/bin/fastapi dev main.py `
Original file line number Diff line number Diff line change 1+ from fastapi import FastAPI
2+
3+ app = FastAPI ()
4+
5+
6+ @app .get ("/" )
7+ async def root ():
8+ return {"message" : "Hello World" }
Original file line number Diff line number Diff line change 1+ fastapi [standard ]
You can’t perform that action at this time.
0 commit comments