Learn Wagtail CMS Course

Getting Started With Your First Home Page

YouTube Video

The link for the full YouTube video is available here: https://www.youtube.com/watch?v=SEPBP0DuoWg

The Final Code

{# templates/home/home_page.html #}
{% block content %}
    {{ self.banner_title }}
{% endblock %}
# home/models.py
from django.db import models

from wagtail.core.models import Page
from wagtail.admin.edit_handlers import FieldPanel


class HomePage(Page):
    """Home page model."""

    templates = "home/home_page.html"
    max_count = 1

    banner_title = models.CharField(max_length=100, blank=False, null=True)

    content_panels = Page.content_panels + [
        FieldPanel("banner_title")
    ]

    class Meta:

        verbose_name = "Home Page"
        verbose_name_plural = "Home Pages"