Source code for www.nickmoreton.co.uk, a Django and Wagtail site with custom content models, a small frontend build pipeline, and Docker-based local development.
webapp/home/,webapp/pages/,webapp/core/, andwebapp/search/contain the Wagtail apps.webapp/settings/contains shared, development, and production settings.webapp/templates/and app-leveltemplates/directories contain Django templates.webapp/static_src/contains Sass, JavaScript, and source images.webapp/static_compiled/contains generated frontend assets served by Django.docker/,docker-compose.yaml, andMakefilecontain local development support.docs/contains deployment, production-mode local checks, data, and media workflows.CHANGELOG.mdrecords notable unreleased and released changes.
- Docker Compose
- Node.js and npm
- Python tooling is installed inside the app container with
uv
Copy the example environment file before running the normal development or Heroku-backed data/media targets:
cp .env.example .envFor basic local development, the placeholder values are enough. Production-mode
local checks can run without .env. Heroku and S3 values are only needed for
data and media sync; see Data and media.
Build the frontend, build and start the containers, run migrations, collect static files, and create a superuser:
make quickstartStart the Django development server:
make runView the site at http://localhost:8000 and the Wagtail admin at http://localhost:8000/admin.
Start the containers if they are not already running:
make upRun Django:
make runIn another terminal, watch frontend assets:
npm startDjango Browser Reload is enabled, so browser pages reload when watched frontend files are rebuilt.
Use this workflow when you want to exercise the site with DEBUG = False,
Gunicorn, Postgres, collected static files, and nginx serving /static/ and
/media/:
make prod-runThis can run from source without first starting the normal development stack or pulling production data/media. It creates a blank production-mode database from migrations unless you later mirror local data into it.
For a first production-mode boot that also prompts for a Wagtail admin user, run:
make prod-quickstartTo pull Heroku data directly into production mode without setting up the normal
local development database first, run make prod-pull-data. To pull S3 media
directly into production mode, run make prod-pull-media.
View the site at
https://prod-nginx.nickmoreton-production.orb.local and the Wagtail admin at
https://prod-nginx.nickmoreton-production.orb.local/admin. Normal development
still uses make up, make run, and npm start.
The stack also exposes a localhost fallback at http://localhost:8001. If port
8001 is already in use, set PROD_PORT, for example
PROD_PORT=8002 make prod-run; the OrbStack HTTPS URL remains the same.
For step-by-step commands and troubleshooting, see Production-mode local checks.
| Command | Purpose |
|---|---|
make quickstart |
First local boot: frontend build, Docker build/start, migrations, static files, superuser prompt. |
make build |
Build Docker images. |
make up |
Start Postgres and the app container. |
make run |
Run Django at http://localhost:8000. |
make migrate |
Run Django migrations inside the app container. |
make prod-quickstart |
First production-mode boot: build/start, migrations, static files, superuser prompt. |
make prod-run |
Build and run production mode from source with Gunicorn behind nginx. |
make prod-destroy |
Stop production-mode containers and remove their Docker volumes. |
make test |
Run the Django test suite inside the app container. |
npm run build |
Build Sass, JavaScript, and images once. |
npm start |
Watch frontend assets during development. |
- Data and media: Heroku/S3 sync, local database dumps, media copy helpers, and cleanup notes.
- Production-mode local checks: run the site locally with
DEBUG = False, Gunicorn, Postgres, and nginx.