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
São Miguel Bus API — Django 3.0 REST backend serving bus schedule data for São Miguel Island (Azores). Uses SQLite in dev, PostgreSQL in production (controlled by `ENVIRONMENT` env var).
8
+
9
+
### Running the API
10
+
11
+
```bash
12
+
cd /agent/repos/SaoMiguelBus-api/src
13
+
python3 manage.py runserver 0.0.0.0:8000
14
+
```
15
+
16
+
Dev mode uses SQLite (no external DB needed). The database file at `src/db.sqlite3` contains pre-seeded route/stop data.
17
+
18
+
### Running tests
19
+
20
+
```bash
21
+
cd /agent/repos/SaoMiguelBus-api/src
22
+
python3 manage.py test
23
+
```
24
+
25
+
### Non-obvious caveats
26
+
27
+
-`psycopg2-binary==2.8.6` in `requirements.txt` is incompatible with Python 3.12+. Install `psycopg2-binary>=2.9` after running `pip install -r requirements.txt` to fix the import error. This only affects the build from source; the newer binary wheel works fine.
28
+
- The settings file imports `dj_database_url` and calls `.config()` which reads `DATABASE_URL` env var. In dev (no `DATABASE_URL` set), this is a no-op and SQLite is used.
29
+
-`GOOGLE_MAPS_API_KEY` and `AUTH_KEY` default to dummy values in dev — the step-by-step directions feature won't work without a real key, but all other endpoints function normally.
30
+
-`ALLOWED_HOSTS` includes `127.0.0.1` so local dev server works out of the box.
0 commit comments