Skip to content

Repository files navigation

Python Prisma Boot

1. Environment

1.1 Create .venv

General Linux

python -m venv .venv

macOS

python3 -m venv .venv

Ubuntu

apt-get update && apt install python3.10-venv

1.2 Activate

source .venv/bin/activate

2. Setup

2.1 Install dependencies

pip install -r requirements.txt

or

pip install -i https://pypi.tuna.tsinghua.edu.cn/simple -r requirements.txt

2.2 Generate database types

cp .env.example .env
prisma generate

3. Run

uvicorn main:app --reload

4. Database

prisma db push
prisma db pull

5. Docker

5.1 Build

docker build -t python-prisma -f Dockerfile .

5.2 Run

docker rm -f python-app;docker run --env-file .env -p 8123:8000 -d --name python-app python-prisma:latest

or

docker-compose down && docker-compose up -d && docker image prune -f && docker-compose logs -f

Test

curl http://localhost:8123

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages