Skip to content

add message in readme to be sure python 3.10 is only supported #20

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 9, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
58 changes: 41 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,22 @@

# Minimal async FastAPI + PostgreSQL template

- [Feauters](#features)
- [Quickstart](#quickstart)
- [About](#about)
- [Step by step example - POST and GET endpoints](#step-by-step-example---post-and-get-endpoints)
- [1. Create SQLAlchemy model](#1-create-sqlalchemy-model)
- [2. Create and apply alembic migration](#2-create-and-apply-alembic-migration)
- [3. Create request and response schemas](#3-create-request-and-response-schemas)
- [4. Create endpoint](#4-create-endpoints)
- [5. Write tests](#5-write-tests)
- [Deployment strategies - via Docker image](#deployment-strategies---via-docker-image)
- [Minimal async FastAPI + PostgreSQL template](#minimal-async-fastapi--postgresql-template)
- [Features](#features)
- [Quickstart](#quickstart)
- [1. Install cookiecutter globally and cookiecutter this project](#1-install-cookiecutter-globally-and-cookiecutter-this-project)
- [2. Install dependecies with poetry or without it](#2-install-dependecies-with-poetry-or-without-it)
- [3. Setup databases](#3-setup-databases)
- [4. Now you can run app](#4-now-you-can-run-app)
- [Running tests](#running-tests)
- [About](#about)
- [Step by step example - POST and GET endpoints](#step-by-step-example---post-and-get-endpoints)
- [1. Create SQLAlchemy model](#1-create-sqlalchemy-model)
- [2. Create and apply alembic migration](#2-create-and-apply-alembic-migration)
- [3. Create request and response schemas](#3-create-request-and-response-schemas)
- [4. Create endpoints](#4-create-endpoints)
- [5. Write tests](#5-write-tests)
- [Deployment strategies - via Docker image](#deployment-strategies---via-docker-image)

## Features

Expand All @@ -47,8 +53,9 @@ _Check out also online example: https://minimal-fastapi-postgres-template.rafsaf

## Quickstart


### 1. Install cookiecutter globally and cookiecutter this project
```bash
# Install cookiecutter globally
pip install cookiecutter

# And cookiecutter this project :)
Expand All @@ -57,21 +64,38 @@ cookiecutter https://github.com/rafsaf/minimal-fastapi-postgres-template
# if you want experimental fastapi-users template
# check "experimental_fastapi_users_template"
# to True in cookiecutter option
```

### 2. Install dependecies with poetry or without it
```bash
cd project_name
# Poetry install (and activate environment!)
### Poetry install (python3.10)
poetry install
# Setup two databases

### Optionally there are also requirements
python3.10 -m venv venv
source venv/bin/activate
pip install -r requirements-dev.txt
```
Note, be sure to use `python3.10` with this template with either poetry or standard venv & pip, if you need to stick to some earlier python version, you should adapt it yourself (remove python3.10+ specific syntax for example `str | int`)

### 3. Setup databases
```bash
### Setup two databases
docker-compose up -d
# Alembic migrations upgrade and initial_data.py script

### Alembic migrations upgrade and initial_data.py script
bash init.sh
# And this is it:
```
### 4. Now you can run app
```bash
### And this is it:
uvicorn app.main:app --reload

# Optionally - use git init to initialize git repository
# Then probably - use git init to initialize git repository
```

#### Running tests
### Running tests

```bash
# Note, it will use second database declared in docker-compose.yml, not default one
Expand Down