You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+40-10Lines changed: 40 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -22,18 +22,22 @@ Follow this guide to set up the api locally for development.
22
22
### Prerequisites
23
23
24
24
> [!note]
25
-
> By default, we are using Docker for the sake of simplicity. If you want to run the API natively, you can check out the section [Native Guide](#native-guide).
25
+
> By default, we are containerizing for the sake of simplicity.
26
+
> If you want to run the API natively, you can check out the section [Native Guide](#native-guide).
26
27
27
-
- Docker
28
-
- An IDE (PyCharm strongly recommended)
28
+
- Docker (or colima, or podman)
29
+
- An IDE —PyCharm is what the docs will usually use.
29
30
30
31
### Set up environment variables
31
32
32
33
You can copy `example.env` to `.env` and fill in the required values.
33
34
34
-
- Set `POSTGRES_PASSWORD` to a secure password.
35
-
- Set `SECRET_KEY` to a secure secret key. You can use `from django.core.management.utils import get_random_secret_key; print(get_random_secret_key())` in a python shell to generate it.
36
-
- Optionally you can set `DEBUG` to `1` if needed
35
+
- Set `POSTGRES_PASSWORD` to a secure password. It will just be for your local machine.
36
+
- Set `SECRET_KEY` to a secure secret key.
37
+
You can use `from django.core.management.utils import get_random_secret_key; print(get_random_secret_key())` in a
38
+
python shell to generate it, or you can let a cat walk on your keyboard.
39
+
- Optionally you can set `DEBUG` to `1` if needed. See the
40
+
[django docs](https://docs.djangoproject.com/en/5.2/ref/settings/#debug) for why you would.
37
41
- Set `RUN_ENVIRONMENT=dev` if you want to see the developer endpoints.
38
42
39
43
### Running the API
@@ -52,11 +56,33 @@ Once the api is started you can run the tests using the following command.
52
56
53
57
Run tests
54
58
```
55
-
docker exec -it mapdb-django-dev pytest
59
+
docker compose exec django pytest
60
+
```
61
+
62
+
If it's not running already then use `docker compose run` instead.
63
+
64
+
### Committing code
65
+
66
+
We use [pre-commit](https://pre-commit.com/) to run checks prior to committing code. Pre-commit's settings are in the
0 commit comments