Create the file repository configuration:
sudo sh -c 'echo "deb http://apt.postgresql.org/pub/repos/apt $(lsb_release -cs)-pgdg main" > /etc/apt/sources.list.d/pgdg.list'
Import the repository signing key:
wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add -
Update the package lists:
sudo apt-get update
Install the latest version of PostgreSQL. If you want a specific version, use 'postgresql-14' or similar instead of 'postgresql':
sudo apt-get -y install postgresql-14
Install Poetry:
pip install poetry
Create the virtual environment and install dependencies with:
poetry install
See the poetry docs for information on how to add/update dependencies.
Run commands inside the virtual environment with:
poetry run <your_command>
Spawn a shell inside the virtual environment with:
poetry shell
Start a development server locally:
poetry run uvicorn api.main:app --reload --host localhost --port 8000
API will be available at localhost:8000/
- Swagger UI docs at localhost:8000/docs
- ReDoc docs at localhost:8000/redoc