Sample FastAPI application.
Note that this is a template project. You will need to make changes to this application if you want to make use of it. Please read the Template readme file for more information on what this project does and how to use the template.
- (Optional) Install Pyenv and the Python version for this project:
pyenv install- Create a virtual environment:
# Note: For POSIX, pyenv can create a named virtual environment which you can use instead.
# For Windows, pyenv-win exists, but doesn't have this feature afaik.
python3 -m venv venv
# Windows
./venv/Scripts/activate
# POSIX
source ./venv/bin/activate- [Windows] Run the
scripts/dev-setup.batscript:
./scripts/dev-setup.bat- [POSIX] Run the
scripts/dev-setup.shshell script using any bash-compatible shell:
bash ./scripts/dev-setup.sh- Create a
.envfile from the given example and edit it:
cp .env.example .env
# Open the new .env file in your favourite editor and make the changes- Run the dev server using
F5key in VSCode. You can also use thedev-launchshell script:
# Windows
./scripts/dev-launch.bat
# POSIX
bash ./scripts/dev-launch.sh- You can also run the server (cli) script:
sample-fastapi --help