This is the story of the part of this website developed in Wagtail, the CMS software running on python-written web framework Django.
The process is well documented (the documentation for wagtail is great), but as the amateur I am, I did find some confusing bits that I would like to document here, for the benefit of people who might want to try as well.
The website is hosted by ecohosting, in a shared server that I manage with cPanel. These are the steps I followed to create the Python app that will run the wagtail site:
$ source virtualenv/unthink/3.8/bin/activate
(unthink:3.8)[unthankx@server ~] $ cd /home/user/name-of-folder
(unthink:3.8)[unthankx@server ~]$ pip install --upgrade pip
(unthink:3.8)[unthankx@server ~] $ cd /home/user/name-of-folder
(unthink:3.8)[unthankx@server ~] $ pip install wagtail
(unthink:3.8)[unthankx@server ~] $ wagtail start unthink
This would leave the app in unthank/unthink and the website in unthank/unthink/unthink, creating problems with the folder structure (which is very important for Python) further down the road. The documentation for Wagtail explains that the folder unthink has been already generated by cPanel, and to use it for the new website it is necessary to add the folder again, as follows:(unthink:3.8)[unthankx@server ~] $ wagtail start unthink unthink
(unthink:3.8)[unthankx@server ~] $
(unthink:3.8)[unthankx@server ~] $cd unthink
(unthink:3.8)[unthankx/unthink@server ~] $ pip install -r requirements.txt
(unthink:3.8)[unthankx/unthink@server ~] $ python manage.py migrate
(unthink:3.8)[unthankx/unthink@server ~] $ python manage.py createsuperuser
from django.db import models
from wagtail.core.models import Page
from wagtail.core.fields import RichTextField
from wagtail.admin.edit_handlers import FieldPanel
class HomePage(Page):
body = RichTextField(blank=True)
content_panels = Page.content_panels + [
FieldPanel('body', classname="full"),
]
{% extends "base.html" %}
{% load wagtailcore_tags %}
{% block body_class %}template-homepage{% endblock %}
{% block content %}
{{ page.body|richtext }}
{% endblock %}