This is a Docker-based Django CMS project. All application code runs inside Docker containers.
| Service | Container | Port |
|---|---|---|
| Django CMS (app) | core_cms |
localhost:8000 |
| PostgreSQL 14.9 | core_cms_postgres |
5432 (internal) |
| Elasticsearch 7.17 | core_cms_elasticsearch |
localhost:9201 |
Use the Makefile instead of raw docker compose commands:
| Command | Purpose |
|---|---|
make setup |
One-command full setup (see caveat below) |
make build |
Build Docker images |
make start |
Start containers (ARGS="--detach" for background) |
make stop |
Stop containers |
make clean |
Stop containers, remove volumes and images |
DJANGO_SUPERUSER_PASSWORD=yourpass make setupmake setup (i.e. bin/setup-cms.sh) handles: settings file creation, Docker build, container startup, readiness polling, migrations, superuser creation, CSS build, and collectstatic. Non-interactive shells (e.g. agent runs) must set DJANGO_SUPERUSER_PASSWORD; a TTY prompts interactively.
Note: Stale containers errors (e.g. core_cms_elasticsearch already in use) come from old Compose state. Ask human whether to remove stale core_cms* containers/projects; once resolved, rerun make setup.
- When updating dependencies, use
npmcommands (e.g.uninstall/install); do not hand-edit lockfile entries. - When installing
@tacc/core-styles, use a published version from the registry, or agit+https://github.com/...spec so install does not require SSH.
- Settings files are gitignored. Created from
*.example.pybybin/setup-cms.shor manually. - Postgres secret files:
docker-compose.dev.ymlmounts./conf/postgres/*.secretfiles. These are not required for development and can be ignored.
secrets.pyElasticsearch host: Should becore_cms_elasticsearch(the Docker hostname), notelasticsearch.- Docker commands may need
sudodepending on the environment. - Elasticsearch cgroups v2: ES 7.17.0 crashes on kernels with cgroups v2 (
CgroupV2SubsystemNPE). If your env is afflicted, you may create adocker-compose.agent.ymlas a workaround (e.g. use ES 7.17.9+ image).
As necessary for given task:
- Lint:
docker exec core_cms flake8 taccsite_cms/ --max-line-length=120(pre-existing warnings expected) - Tests:
docker exec core_cms python manage.py test __ANYTHING_YOU_CHANGE_THAT_HAS_TESTS__ --no-input - CSS build:
docker run --rm -v "$(pwd):/code" -w /code node:20 sh -c "npm ci && npm run build" - Collect static:
docker exec core_cms python manage.py collectstatic --no-input
See README.md for full setup instructions.
- Format:
.gitmessage(fallback:~/.gitmessage)
- Title:
.gitmessage(fallback:~/.gitmessage) - Description:
.github/PULL_REQUEST_TEMPLATE.md- Be concise: plain language, simple sentences; reviewers find detail in the diff. Say what changed, then why (if it matters) — never how.
- When updating, first re-read the current description, because it may have been edited.