# Wagtail CMS

This guide will help you understand how to config Wagtail CMS.

# Create Admin

Let's create superadmin, you can skip this step if you already have one.

(venv)$ ./manage.py createsuperuser

And then login on http://127.0.0.1:8000/cms (opens new window)

# Setup Site

In the sidebar, click Settings/Sites

You should config the domain and port on production site, so the absoluate URL would be correct.

On local, you can just change the port to 8000 (this is optional)

# Site Settings

In the sidebar, click Settings/Home page Settings

You can add feature and testimonial on this page, after you are done, you can check the result on http://127.0.0.1:8000/ (opens new window)

# How it works

We use Wagtail to help us manage content, in Django template, we can iterate to render the content.

{% with features=wagtail_settings.cms.HomePageSettings.features %}
  {% for feature in features %}
    {% include 'cms/components/home_feature.html' with value=feature.value only %}
  {% endfor %}
{% endwith %}

With Site Settings, you can use Wagtail to help you manage content of the specific sections in Django template.

# Create Pages

Next, please go to http://127.0.0.1:8000/cms/pages/2/ (opens new window), and create pages as children of the Welcome to your new Wagtail site!

The page tree should look like this

/                       Welcome to your new Wagtail site

    blog                BlogPage
        post-page       PostPage

    contact             FormPage

    privacy-policy      StandardPage
    cookies             StandardPage

# Resources

  1. Wagtail official Doc (opens new window)
  2. Build Blog With Wagtail CMS (opens new window)