https://github.com/bugbiteme/fastapi-test
https://github.com/bugbiteme/fastapi-test
Last synced: 7 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/bugbiteme/fastapi-test
- Owner: bugbiteme
- Created: 2023-12-14T16:06:14.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2023-12-16T19:40:24.000Z (over 2 years ago)
- Last Synced: 2025-06-28T15:47:09.045Z (11 months ago)
- Language: Python
- Size: 14.6 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# fastapi-test
Following tutorial at https://fastapi.tiangolo.com/tutorial/
To build and run a container:
```
podman build -t fastapi-test .
podman run -p 8000:8080 fastapi-test
```
This command runs the podman container, mapping port 8000 on your local machine to port 8080 in the podman container (which your FastAPI app should be listening on).
## To test locally
If you're not already doing so, consider using a virtual environment. This isolates your project's dependencies from the global Python environment and can often resolve conflicts and dependency issues.
```
python -m venv venv
source venv/bin/activate # For Unix or MacOS
venv\Scripts\activate # For Windows
pip install --upgrade pip
pip install -r requirements.txt
uvicorn main:app --reload
```
## To clean up python virtual environment
- If you are currently inside a virtual environment, you'll need to deactivate it first. You can do this by running the deactivate command in your terminal or command prompt.
```
deactivate
```
This will return you to your system's default Python environment.
Once you've deactivated the virtual environment, you can simply delete its directory to remove it completely. The virtual environment is just a directory containing all the necessary files, so removing this directory will delete the environment.
```
rm -rf venv # Unix/Linux/MacOS
rmdir /s /q venv # Windows
```
For some swagger action:
```
/docs
/redocs
```