Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/kennytian/python-prisma-boot
https://github.com/kennytian/python-prisma-boot
Last synced: about 1 month ago
JSON representation
- Host: GitHub
- URL: https://github.com/kennytian/python-prisma-boot
- Owner: Kennytian
- License: mit
- Created: 2024-11-27T13:50:54.000Z (about 1 month ago)
- Default Branch: master
- Last Pushed: 2024-11-27T13:54:25.000Z (about 1 month ago)
- Last Synced: 2024-11-27T14:44:48.959Z (about 1 month ago)
- Language: Python
- Size: 0 Bytes
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Python Prisma Boot
## 1. Environment
### 1.1 Create .venv
General Linux
```shell
python -m venv .venv
```macOS
```shell
python3 -m venv .venv
```Ubuntu
```
apt-get update && apt install python3.10-venv
```
### 1.2 Activate
```shell
source .venv/bin/activate
```## 2. Setup
### 2.1 Install dependencies
```shell
pip install -r requirements.txt
```or
```shell
pip install -i https://pypi.tuna.tsinghua.edu.cn/simple -r requirements.txt
```### 2.2 Generate database types
```shell
cp .env.example .env
``````shell
prisma generate
```## 3. Run
```shell
uvicorn main:app --reload
```## 4. Database
```shell
prisma db push
``````shell
prisma db pull
```## 5. Docker
### 5.1 Build
```shell
docker build -t python-prisma -f Dockerfile .
```### 5.2 Run
```shell
docker rm -f python-app;docker run --env-file .env -p 8123:8000 -d --name python-app python-prisma:latest
```
or```shell
docker-compose down && docker-compose up -d && docker image prune -f && docker-compose logs -f
```## Test
```shell
curl http://localhost:8123
```