2022-02-15 22:58:28 -05:00
|
|
|
# CMS Management
|
|
|
|
|
|
|
|
A management site for the [Claremont MakerSpace](https://claremontmakerspace.org)
|
|
|
|
|
|
|
|
## Development
|
|
|
|
|
2024-07-22 22:34:52 -04:00
|
|
|
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/)
|
2022-02-15 22:58:28 -05:00
|
|
|
2. Run `pdm install`
|
2024-07-22 22:34:52 -04:00
|
|
|
3. Create `settings.dev.env` with config as required by [./cmsmanage/settings.py](`./cmsmanage/settings.py`)
|
2023-11-21 13:51:11 -05:00
|
|
|
4. Run `pdm run ./manage.py migrate` to create database tables
|
2024-07-22 22:34:52 -04:00
|
|
|
- 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.
|
2022-02-15 22:58:28 -05:00
|
|
|
5. (Optional) If you have access to the production server, you can use real data:
|
2023-11-21 13:51:11 -05:00
|
|
|
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
|
2024-07-22 22:34:52 -04:00
|
|
|
|
|
|
|
### 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
|