Questions tagged [wagtail]

Wagtail is a Django content management system (CMS), focused on flexibility and user experience. When using this tag, you may also want to add the [django] tag to improve visibility.

Wagtail is a content management system built originally for the Royal College of Art and focused on flexibility and user experience.

Its features include:

  • A fast, attractive editor interface
  • Complete control over design with standard Django templates
  • Configure content types through standard Django models
  • Tightly integrated search (with an Elasticsearch backend for production)
  • Strong document and image management
  • Wide support for embedded content
  • Simple, configurable permissions
  • Support for tree-based content organisation
  • Optional preview->submit->approve workflow
  • Fast out of the box. Varnish-friendly if you need it

Useful links

2300 questions
6
votes
2 answers

How can I create Page and set its StreamField value programmatically?

I want to create a BlogPage programmatically in wagtail with setting its StreamField value. I can set heading field. But I'm getting AttributeError: 'unicode' object has no attribute 'source' when I try to set the paragraph field. I want to set an…
6
votes
1 answer

Wagtail: how to change the default root and/or home page

How do I create my custom home page at the root level for my site? I'm integrating wagtail to my django project. As documented I try to plug my custom homepage model and create a new site record ... You’ll probably want to replace this with your…
Tiny Instance
  • 2,351
  • 17
  • 21
6
votes
2 answers

How can I make a Wagtail Streamfield not required?

In the model below I want to make the bottom_content field in its entirety not required. How can I do this? class ServicePage(Page): top_content = StreamField(default_blocks + [ ('two_columns', TwoColumnBlock()), ('three_columns',…
NVN
  • 147
  • 2
  • 7
6
votes
1 answer

Globally getting context in Wagtail site

I am working on a Wagtail project consisting of a few semi-static pages (homepage, about, etc.) and a blog. In the homepage, I wanted to list the latest blog entries, which I could do adding the following code to the HomePage model: def…
mathiascg
  • 550
  • 1
  • 5
  • 15
6
votes
2 answers

How do you give a wagtail/django Page a custom url to serve at?

In wagtail/django how do you make a basic wagtail Page model, create the html template, and then tell that model to serve as a view for a specific url? from django.db import models from wagtail.wagtailcore.models import Page class MyPage(Page): …
6
votes
2 answers

Partial matching search in Wagtail with Postgres

I've got a wagtail site powered by Postgres and would like to implement a fuzzy search on all documents. However, according to wagtail docs "SearchField(partial_match=True) is not handled." Does anyone know of a way I can implement my own partial…
fina
  • 309
  • 2
  • 10
6
votes
2 answers

How to resolve cannot import name pages (django/wagtail)

Recently I have been trying to get wagtail to work with my existing Django application. I was experiencing an error: - ImportError: No module named wagtail unable to load app 0 (mountpoint='') (callable not found or import error) After much…
Gary
  • 1,086
  • 2
  • 13
  • 39
6
votes
2 answers

Use Wagtail CMS Snippets but Hide in Admin Panel

I am building custom AdminModels based on Wagtail Snippets and have a custom menu in the AdminPanel for my models. How do I hide/remove the Snippet selection from AdminPanel without disabling? Thank you.
Charles Smith
  • 3,201
  • 4
  • 36
  • 80
6
votes
2 answers

TableBlock how to specify table CSS classes

I am struggling to add CSS classes to Wagtail StreamField & TableBlock (http://docs.wagtail.io/en/v1.8.1/reference/contrib/table_block.html). Is the way to go to define a filter and use something like: {{ child|className:"table table-bordered"…
Dimitar Petrov
  • 667
  • 1
  • 5
  • 16
6
votes
4 answers

Modifying the Wagtail publish dropdown (per app)

I'd like to reconfigure the default "Publish" menu. The default configuration is this: I'd like to make Publish the default action, and move it to the top. I'd also like to remove Submit for Moderation, as our site has no current need for that…
shacker
  • 14,712
  • 8
  • 89
  • 89
6
votes
3 answers

Server error 500 Wagtail-admin

Currently I'm deploying a Wagtail project. It seems everything working fine so far but there is one issue I can't get rid of. When I'm trying to access the Wagtail admin url I get an internal server error since I changed my settings file DEBUG to…
Lepus
  • 567
  • 6
  • 22
5
votes
1 answer

Using or reusing Wagtail StreamField blocks as Fields in other models

I have a Wagtail project with two different Page models that use identical gallery blocks, but in different ways. In one model, I want to use the gallery in a list of other freeform blocks; but in the other model there is only one gallery appearing…
axoplasm
  • 502
  • 2
  • 10
5
votes
1 answer

Using a Wagtail "ChoiceBlock" with dynamic choices rather than a hardcoded list

We have a setup with a Blog model that has a manytomany relation for BlogPageCategory, and we have a "recent blog posts" streamfield block that lets you specify whether to show cards for X latest blog posts, or X latest blog posts from a specific…
Mike 'Pomax' Kamermans
  • 49,297
  • 16
  • 112
  • 153
5
votes
1 answer

cannot import name 'detail_route' from 'rest_framework.decorators'

I'm trying to run longclaw, but i get an error $ python manage.py makemigrations catalog home Traceback (most recent call last): [...] File "/lib/python3.7/site-packages/longclaw/basket/api.py", line 1, in from…
5
votes
2 answers

Add column heading (and corresponding property) to Wagtail index view

My team and I have created a section to allow our company to add landing pages. We'd like to include some additional columns to the index view of the associated model, as illustrated in this image. I've found a few old posts (2014-ish) that…
commadelimited
  • 5,656
  • 6
  • 41
  • 77