This project has been created using the amazing Wagtail CMS.
This project is meant to be a minimalistic Wagtail site demo, which can be referenced to build a more extensive Wagtail site. This differs from the wagtail start mysite mysite
site as it contains some of the basics I find I almost always need, such as frontend tooling, CI, pre-commit linting, hosting configuration (e.g. Fly.io), etc.
For this stack, I'm aiming to keep the dependencies light so that this website can be cheaply (if not freely) hosted using minimal resources.
Also worth checking out the Wagtail Bakery demo site which uses a different stack. The main difference being that this uses SQLite instead of postgres.
Document contents
We use Docker to set up a local build for development.
git clone https://github.com/victoriachan/wagtail-startup-site.git
cd wagtail-startup-site
docker-compose build
docker-compose up -d
The local site will now be accessible at http://localhost:8000/ and the Wagtail admin interface at http://localhost:8000/admin/.
docker-compose exec web bash
You can then run the usual Wagtail commands:
./manage.py collectstatic
./manage.py migrate
./manage.py createsuperuser
This site uses SQLite database. To backup / restore the database, simply copy and replace the data/db.sqlite3
file. On local builds, this file is mounted as a bind mount, and will persist between docker builds unless explicitly deleted.
Similarly, the data/media
(Wagtail Image and Document files) directory is mounted as a bind mount, and will persist between docker builds unless explicitly deleted. Likewise, it can be backed up and restored by simply copying and replacing the directory.
docker-compose stop
To tail the logs from the Docker containers in realtime, run:
docker-compose logs -f
We use pip-tools to manage these.
To update pip packages, edit requirements.in
, and then run:
pip-compile --allow-unsafe --generate-hashes
pip install -r requirements.txt
Frontend css and js src files are in static_src/
directory, and are compiled into static_compiled/
. By default if not changing any frontend files, the CSS and JS should already be compiled on a fresh docker build.
For working with frontend files, see documentation about Frontend tooling.