DEV Community

srinithivijayakumars139-wq
srinithivijayakumars139-wq

Posted on

Setting up Wagtail Bakerydemo Locally: What I Learnt

What I Learned Setting Up the Wagtail Bakerydemo Locally

I am preparing a Google Summer of Code proposal for Wagtail. One of the first tasks was to set up the bakerydemo project locally. This post shares what I did, what surprised me, and what I learned.

What is bakerydemo?

Bakerydemo is Wagtail's official demo website. It shows how to build a real site using Wagtail, a Django-based CMS. The site was themed around bakery. It has blog posts, bread pages, and location pages. Developers use it to learn Wagtail and test new features.

Setting it Up

The setup steps are straightforward if you follow the README.

Here is what I did:

  1. Cloned the repository from GitHub
  2. Created a virtual environment with Python
  3. Installed dependencies using pip install -r requirements/dev.txt
  4. Ran migrations with python manage.py migrate
  5. Loaded demo data using python manage.py load_initial_data
  6. Started the server with python manage.py runserver
  7. The site was running at http://127.0.0.1:8000/ in about ten minutes.

The thing that tripped me up: I initially forgot to load the initial data. The site ran, but all the pages were empty. Running load_initial_data filled everything in.

What I Noticed in the Templates

Once the site was running, I started reading the templates. A few things stood out.

The Wagtail Bakerdemo website

Template inheritance is flat. Most page types extend base.html directly. The blog listing, locations listing, and breads listing each have their own layout code. A lot of this code is repeated. If you want to change how cards look, you have to edit three separate files.

Colors are hardcoded. The CSS in main.css uses fixed hex values for colors. There are no CSS custom properties. This makes theming hard. If you want a dark mode, you have to change dozens of values.

StreamField is powerful. I spent time reading how the bread pages use StreamField blocks. Each block is a separate component. You can mix and match them on any page. This is one of Wagtail's best features.

What I Want to Change

These observations shaped my GSoC proposal. I want to:

  • Introduce CSS custom properties so theming is easy.
  • Extract shared layout patterns into reusable template components.
  • Make listing layouts that work well at 50 or more pages.

The goal is to make the demo site useful for more than just bakery projects. It should work as a starting point for any kind of website.

Final Thoughts

Setting up bakerydemo was quick. Reading the code took longer, but it was worth it. I now understand how Wagtail structures a real project. That understanding is the foundation for the work I plan to do this summer.

If you are learning Wagtail, I recommend setting up bakerydemo. Run it, click around, then open the templates. You will learn a lot just by reading how the pieces connect.

Top comments (0)