From e006a6eb50dd50f50baa481ab0393b368098be93 Mon Sep 17 00:00:00 2001 From: Adam Goldsmith Date: Mon, 22 Jul 2024 22:34:52 -0400 Subject: [PATCH] Update the development notes in the README --- README.md | 27 ++++++++++++++++++++++++--- 1 file changed, 24 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 5d1bc76..3fe0b5d 100644 --- a/README.md +++ b/README.md @@ -4,12 +4,33 @@ A management site for the [Claremont MakerSpace](https://claremontmakerspace.org ## Development -1. Get Python 3.9 and [PDM](https://pdm.fming.dev/) +This assumes a relatively recent Linux system. +It should work fine on MacOS, and might work on Windows. + +### Python Setup + +1. Get Python 3.11 and [PDM](https://pdm.fming.dev/) 2. Run `pdm install` -3. Copy `./cmsmanage/settings/dev.sample.py` to `./cmsmanage/settings/dev.py` +3. Create `settings.dev.env` with config as required by [./cmsmanage/settings.py](`./cmsmanage/settings.py`) 4. Run `pdm run ./manage.py migrate` to create database tables + - At present, this will require an annoying amount of manual + fiddling to create the `JSON_TABLE` views (due to MariaDB bugs) + unless you run this as the root user for the database. 5. (Optional) If you have access to the production server, you can use real data: 1. `pdm run ./manage.py dumpdata -o whatever.json` (on the server) 2. `pdm run ./manage.py loaddata whatever.json` (on your machine) 6. Run `pdm run ./manage.py createsuperuser` to make a user -7. Run `pdm run ./manage.py runserver` to start the server + +### JavaScript setup + +1. Install NodeJS and [pnpm](https://pnpm.io/installation) +2. Run `pnpm install` + +### Running the dev server + +- If you don't intend to work on the JavaScript code: + - `pnpm run build` to build the JS/CSS + - `pdm run ./manage.py runserver` to start the Django server +- Otherwise: + - `pnpm run dev` to start the Vite dev server + - `DJANGO_VITE_DEV_MODE=true pdm run ./manage.py runserver` to start the Django server