This directory contains best practices for working with Wagtail, DataMade's preferred content management system.
- When to use Wagtail
- How to use Wagtail
- Supporting editors
- Research
- Resources for learning
- Wagtail Cache
A content management system such as Wagtail allows users of a site to add, edit, and delete certain content through a friendly interface separate from the project's code. Wagtail should be used for projects where a client would like the ability to modify content directly without DataMade as an intermediary.
When at all possible, Wagtail setup should happen at the beginning of a project concurrent with Django setup. Development with a CMS in mind is easier and faster than retrofitting a project with a CMS.
Instead of initializing a Django project with django-admin startproject
, a Wagtail project should be initialized with:
wagtail start <YOUR PROJECT NAME>
See more on getting started with Wagtail here.
A CMS is only as powerful as it helps its editors to be. Wagtail offers an editor's guide here, which can be shared directly with clients.
For any site where people outside DataMade will be using Wagtail, consider creating a non-technical version of the site documentation. For examples that can be used as templates, see:
- Before beginning a first Wagtail implementation, all developers should read The Zen of Wagtail to familiarize themselves with the guiding concepts.
- After that, the official Wagtail documentation is a good place to start.
We recommend the wagtail-cache
library for invalidating the cache whenever a user edits a Wagtail page model. It's simple and lightweight. Follow the docs to get it setup.
Note that wagtail-cache won't invalidate any changes to a custom, non-Wagtail model that is managed in the Wagtail admin dashboard. In that case you'll still need to use the built-in Django caching.
More info about this adoption: