Hi. I will guide you through the installation of Python, Pipx, Poetry and fastapi.
go to google and write python download
1, Download Python from official website and install it.
2, Then install Pipx through cmd
write this command in cmd to install pipx py -m pip install --user pipx
copy this script path
Type cd and paste the path, then press enter.
now cmd in script path
Now enter the following command to ensure the path:
.\pipx.exe ensurepath
Step 1: Install pipx
Open your terminal.
Install pipx using pip: python -m pip install --user pipx
Step 2: Ensure pipx's binary directory is in your PATH: python -m pipx ensurepath
Step 3: Restart your terminal to apply the PATH update.
Step 4: run the command pipx install poetry
Step 5: To check the version run poetry --version
Create a folder and open it in VSCODE
now poetry install we will add new project wit fast api
Step 6: Create a new project with poetry new uit-api-class --name uitclass
new project created...
Step 7: open the sub folder inside of the parent folder, in this case uitclass
Step 8: Now create a new file named main.py
Step 9 (optional): Check the version of python with the command poetry run python --version
now add fastapi
now we go in to project folder using CD command
Step 10: poetry add fastapi "uvicorn[standard]"
fast api added
Step 10a (optional): Check the packages inside of the pyproject.toml
Step 11: Write the hello world code in the main.py file:
https://github.com/panaverse/learn-ge...
now we run the server using port 8000
Step 12: run the server: poetry run uvicorn uitclass.main:app --host 0.0.0.0 --port 8000
our server starts on port 8000
now try these url to check your project is running on fast api
i will use http://localhost:8000
Step 13: Open the following urls:
http://0.0.0.0:8000/
http://0.0.0.0:8000/docs
http://0.0.0.0:8000/openapi.json
or
http://localhost:8000
now our project is running on localhost port 8000
Thank you for watching........
Please like and subscribe for more videos like this///