In this tutorial we fill an empty cloned Wagtail site with content.
When cloning our site to a server, all models, forms and business logic is there, but the database is still empty. In many cases there will be a backup of an existing or previous version of the site to fill the database. In this tutorial however, we will quickly recap and document the steps from all our previous tutorials to do this manually. Our site is a multilingual Wagtail site, set up with Wagtailtrans, with a custom navigation menu and language switch and a contact page built with a form builder from Wagtailstreamforms.
There will be no new code, everything is done in the editor. Below are the steps. Before we start, we should check whether the compatibility issue of Wagtailstreamforms is solved; if not, either fork the repository or change the code and document it well.
If you have followed a previous tutorial, we start where we left off: go to the server, enter the virtual environment and type
python3 manage.py runserver 0.0.0.0:8000
and in your browser visit the IP-address of your site on port
8000, in our case http://22.214.171.124:8000. Go to the Wagtail admin.
In admin, go to Settings / Languages and add all languages
Go to Pages, click on the house icon on top to arrive at the root, click on 'Add child page' and choose the Translatable Site Root Page model to create a new root. Add a title (e.g. 'Translatable Root') and Publish. Go to Settings / Sites, click on the current site (which by default should be called
localhost, but which you can rename), and choose as 'Root page' the newly created Translatable Root page. Save and go back to Pages, delete the Home page (which was the previous 'Root page').
Go to Pages and choose the Translatable Root page, click on Add child page and select the Home Page model. Type a title and an introduction. Go to the Promote tab and change the slug into
/en/ (or whatever your default language is) and publish. Edit the home pages in the other languages to have translated content, change the respective slugs into the respective language codes and publish.
Go to images, click Add an image and select all images from your computer that you want to add.
Add a child page to the home page and choose the model
ArticleIndexPage. Type a title and an introduction and publish. Create an
ArticlePage as a child of this page and add text, images, embedded video etc. Add more article pages. Go to the home page and add the article index page to it. Repeat this for the home pages in other languages.
Go to Snippets, click on Themes and then Add theme, add some themes and save. Go to Pages, create a
ThemeIndexPage and children
ThemePages for every theme, add images and text. Go to the home page and add the theme index page to it. Repeat this for the home pages in other languages. Go to Django admin at
http://126.96.36.199:8000/django-admin/, click on
Themes and add the translations for the themes in all languages.
Go to Snippets, click on Menus and create the menus
Language with their respective url's, pages, images, submenus. Go to Django admin to translate them.
Footer menu with these items. Also in Snippets, add a company logo.
Go to Streamforms, add a contact form. In the tab Advanced, add a to-address. Go to Pages, create a Contact Page. Add it to the main menu.
Comment on this article (sign in first or confirm by name and email below)