Skip to content
Merged
Show file tree
Hide file tree
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
50 changes: 2 additions & 48 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,60 +63,14 @@ Apply `initial_data.json` fixture. This action will erase all previous data:
make loaddata
```

*Default admin password for local development is `admin`.*

#### Run tests

```shell
make tests
```

### Using docker compose

#### Step 1: Build

```shell
docker compose -p django_atomic_transactions -f environment/docker compose.yml build
```

#### Step 2: Migrate

Apply django migrations:

```shell
docker compose -p django_atomic_transactions -f environment/docker compose.yml run --rm --service-ports web migrate
```

#### Step 3: Run service

* **Runserver**

Run django runserver command:

```shell
docker compose -p django_atomic_transactions -f environment/docker compose.yml run --rm --service-ports web dev
```

* **Uvicorn**

Run uvicorn server:

```shell
docker compose -p django_atomic_transactions -f environment/docker compose.yml run --rm --service-ports web uvicorn
```

#### Step 4: Load sample data

Apply `initial_data.json` fixture. This action will erase all previous data:

```shell
docker compose -p django_atomic_transactions -f environment/docker compose.yml run --rm --service-ports web loaddata
```

#### Step 5: Run tests

```shell
docker compose -p django_atomic_transactions -f environment/docker compose.yml run --rm --service-ports web python manage.py test --failfast api
```

## Know issues

### Database connection error: web service could not connect to db service
Expand Down
2 changes: 1 addition & 1 deletion environment/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# ---------- Base ----------

FROM python:3.9.7-alpine3.14 AS base
FROM python:3.12.11-alpine3.22 AS base

ENV PYTHONUNBUFFERED 1

Expand Down
1 change: 0 additions & 1 deletion src/django_atomic_transactions/settings.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import os


BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))

SECRET_KEY = os.environ.get('SECRET_KEY', '')
Expand Down