I have added wagtail CMS’s blog author in my ‘models.py’ also exposed it in API, but it’s showing like this in API Here’s the models.py code How do I serialize like this show author name, website, image and id? I tried to Serialize the BlogAuthor And here is the API field APIField(“blog_authors”, serializer=AuthorSerializer(many=True)), When I runserver I got this error
Tag: wagtail
Edit Form Submit handler for a Model
I have a fairly simple django model in a Wagtail CMS; essentially: I need to perform an action when this model is saved via the Wagtail model edit form (eg /admin/section/thingy/123/edit). Currently, I have registered a post_save signal, however this has resulted in the method being called when the model is saved programmatically (via an import sync task). I’ve had
How to specify a template for a Snippet in a StreamField when using SnippetChooserBlock
I want to use a snippet in a StreamField: my_page.html: However, when rendering the Advert it renders only the str representation of self.text. How can I specify a template layout for the snippet block, e.g. like a StructBlock? There is no documentation for SnippetChooserBlock. Answer Like all block types, SnippetChooserBlock accepts a template argument that specifies the path to a
Wagtail/Django – How to find the template name of wagtail root home page?
I have a root home page made using the default model that comes out of the box with Wagtail. I’m currently trying to create a navbar header that maps out children pages in the following manner: The problem here is, I’m using the wrong tag. Above I use home_page, but that does not seem to work. I am able to
Reverse for ‘wagtailadmin_explore’ with arguments ‘(”,)’ not found
I have been trying to rebuild my Wagtail website as a docker container to be run on Fargate. For reasons, I started from scratch and rebuilt all my dependencies. After pip installing everything, the site works fine locally using venv. However, I get strange errors when launching the in the Docker container. Can anyone help me identify a fix for
no such table: wagtailcore_site
I’m hosting two websites on ubuntu server and both having postgresql, the first one is working prefect but the second give me this error no such table: wagtailcore_site Request Method: GET Django Version: 2.2.10 Exception Type: OperationalError Exception Value: no such table: wagtailcore_site Exception Location: /home/project2/.venv/lib/python3.7/site-packages/django/db/backends/sqlite3/base.py in execute, line 383 Python Executable: /home/project2/.venv/bin/python3.7m Python Version: 3.7.3 database settings for first
How to break lines when using wagtail BlockQuoteBlock?
I have this model: When I’m saving page with some text using blockquote I use some line breakes and even <br> tags: But on the page there are no line breaks after it: So how to make this work and save line breaks? I’m using wagtail 1.13.1. Answer I think it was done because of security reasons. But It is
How to change django wagtail’s admin logo
I am working on a small project and I thought I’d give wagtail a try. I am now wondering how I could change wagtail’s admin logo in the sidebar (top left image on the picture bellow). I could change /static/wagtailadmin/images/wagtail-logo.svg directly but it’d be wrong ;). Answer Wagtail already provide the solution in the official documentation using django-overextends: To replace