Get started

25 Nov 2015

Wagtail 1.2: Full Jinja, Settings, Search++

1.2 brings a slew of new features, UI polish and performance enhancements. Here are some highlights.

Tom Dyson

Tom Dyson

Director, Torchbox

Badger Test 2

Jinja support

Jinja Wagtail

Wagtail 1.1 and Django 1.8 made it possible for developers to use third party template engines, but 1.2 adds full support for Jinja2, with a complete set of Jinja-compliant template tags ('pageurl', 'slugurl', 'image', 'richtext' and 'wagtailuserbar'). At Torchbox we've always been happy with native Django templating, but Jinja2 clearly has many enthusiastic fans, and reports of dramatic performance improvements are compelling. For full details on switching template engines, see the update notes.

Settings app

Tim Heap's Wagtail Settings is a popular third party Wagtail app which makes it easy to manage site settings (e.g. social media accounts, Google Analytics keys, 'special' pages) within the admin interface. We've been using the app in most of our own Wagtail sites, and recommending it to others, so we asked Tim to contribute it to the core project. As a general rule, we recommend keeping site configuration in code, rather than the database, but we recognise that site administrators sometimes need to change settings outside of the git commit / test / deploy cycle. 

Settings is a contrib app, so you need to add it to your 'INSTALLED_APPS' if you want to use it. Full docs here

Search improvements

Many of the updates in 1.2 come from our recent experience of working on large Wagtail sites, including a popular news site with more than 250,000 images and articles. Improved search is one of these updates: it's now easy to run full-text searches on document and image models, just like on pages, and to combine these with standard ORM filters, like this:

Image.objects.filter(uploaded_by_user=user).search("Hello")

All searches now allow you to define the operator (so 'apples pears' returns results for 'apples AND pears' or 'apples OR pears') and the way that results are ordered (by relevance, or by your QuerySet's ordering).

Browsable API

Browsable API

This feature - inherited from the excellent Django REST Framework project - makes it easier to explore the API for your Wagtail site's public content. We're increasingly seeing Wagtail used as a 'headless CMS', where the front end is rendered by a JavaScript framework (typically React) or a native mobile app, and we added this feature to help our own developers build sites which follow this model.

Everything else

There's a host of other improvements, from Python 3.5 support to spinner animations, and the usual range of bug fixes, most of which were contributed by the expert and growing Wagtail community. Our releases are designed to be big enough that there's a reason for everyone to upgrade, and small enough that they take less than an hour for most installations. For most people, upgrading to 1.2 should just need an update to your requirements.txt and ./manage.py migrate, but make sure you read the full release notes and upgrade considerations. We hope you like it!