Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/amoghmadan/python-fastapi-rest-starter

Kick starter to your REST project.
https://github.com/amoghmadan/python-fastapi-rest-starter

alembic fastapi sqlalchemy

Last synced: about 1 month ago
JSON representation

Kick starter to your REST project.

Awesome Lists containing this project

README

        

# Python FastAPI REST Starter

Kick-starter to your REST application.

## How to set up environment variables?

- Fill the .env file with the following values, they might need adjustment.
```dotenv
DEBUG= # Dev: True
SECRET_KEY= # Dev: a1b2c3d4e5f6g7h8i9j10k11l12m13n14o15p16q
DATABASE_URI= # Dev: sqlite:///db.sqlite3
```

## How to set up project for development?

- Create a virtual environment: -
```bash
python -m venv venv
```
- Activate: -
- Windows: `venv\Scripts\activate`
- Unix-like: `. venv\bin\activate`
- Install dependencies: -
```bash
pip install . -e '.[automation,sqlite,test]'
```
- Run: -
```bash
uvicorn app.asgi:application --reload
```

## How to set up project for deployment?

- Create a virtual environment: -
```bash
python -m venv venv
```
- Activate: -
- Windows: `venv\Scripts\activate`
- Unix-like: `. venv\bin\activate`
- Install dependencies: -
```bash
pip install -e '.[sqlite,deployment]'
```
- Run: -
```bash
gunicorn app:asgi:application -b 0.0.0.0:8000 -w 4 -k uvicorn.workers.UvicornWorker --log-level INFO
```