Wagtail, the opinionated best practice.
$ docker build -t hbrls/wagtail:{version} .
For most of the time, you will continue to install app-specific dependencies. So I left the USER root there.
Before start your final app, you should set it to USER www-data.
RUN sed "s/#logformat/$(cat /path/to/uwsgi-logformat.yaml)/" /uwsgi.yaml to use your customized logformat.
-
Initialized database
$ mysql> CREATE DATABASE wagtailexample CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci; $ mysql> CREATE USER 'wagtailexample'@'%' IDENTIFIED BY 'wagtailexample'; $ mysql> GRANT ALL PRIVILEGES ON wagtailexample.* TO 'wagtailexample'@'%' $ mysql> FLUSH PRIVILEGES; $ wagtail start appl $ python manage.py makemigrations $ python manage.py migrate $ python manage.py createsuperuser # wagtail:wagtail, wagtail@wagtailexample.com $ python manage.py collectstatic
-
Change the default home page to our own
~/home/models.IndexPage.- 在
Welcome to wagtail下新建IndexPage,然后将它转移到Root下 - 到 "设置 > 站点 > Root Page" 将默认首页设置为
IndexPage
- 在
-
Add example of page/subpage hierarchy
Root Welcome to wagtail 首页 <- the de facto root 博客文章列表 博客文章列表 一类文章 二类文章 关于我们 -
Add example of
WhateverPageandAgreementPage. TheHallo.jsWagtail 1.5.3 is using doesn't support<h1>. Waiting for the next major release.
- "设置 > 站点"
-
~/templatesfor templates. -
~/staticis the destination of assets. -
DJANGO_ENV: 'dev', 'sit', 'prod', ... to distinguish deploy environments. -
The code (e.g.
~/home/models.py,~/blog/models.py) provide Page Types to be used. The structure (i.e. site map) is up to your settings from the admin panel. -
You would be requested a bunch of carefully-designed-hard-coded-pages. Just list their empty classes in
~/home/models.py(e.g.About) and do the hard code and admin panel settings. -
For do-whatever-you-like pages, just choose
~/home/models.Whateverin the admin panel. You can also customize your own class like~/home/models.Agreementfor a set of similar whatever pages.
| package | version | date |
|---|---|---|
| Wagtail | 5.2.3, LTS | 2024-01-23 |
| Django | 4.2.9, LTS | 2024-01-02 |
| Pydantic | 2.5.3 | 2023-12-22 |
| Django-Ninja | 1.0.1 | 2023-11-17 |
| Jinja2 | 3.1.2 | 2022-04-28 |
| MarkupSafe | 2.1.3 | 2023-06-03 |
| django-rest-framework | 3.14.0 | 2022-11-08 |
| django-modelcluster | 6.2.1 | 2024-01-04 |
| django-taggit | 4.0.0 | 2023-05-04 |
| django-treebeard | 4.7.1 | 2024-01-31 |
| django-filter | 23.5 | 2023-12-05 |
| beautifulsoup4 | 4.12.3 | 2024-01-18 |
| Pillow | 10.2.0 | 2024-01-02 |
| pillow_heif | 0.13.1 | 2023-10-15 |
| Willow | 1.6.3 | 2023-11-26 |
| requests | 2.31.0 | 2023-05-22 |
- https://github.com/apihackers/docker-wagtail
- Official: Your first Wagtail site
- Official: Wagtail demo project
$ python manage.py showmigrations --plan
$ python manage.py sqlmigrate {app_name} {migration_name}
$ python manage.py migrate {app_name} {migration_name} --fake- Django@3.0.14, 2021-04-06, claims to support Python@3.9 at v2.2.17, which is not true
- PyMySQL@1.0.0, 2021-01-07, to replace mysqlclient
- Pillow@8.1.2, 2021-03-06
- Wagtail@2.11
- Django@3.2.6, 2022-10-04
- drops Django@3.1, Python@3.6
- Django@4.1.10, 2023-07-03
ImageChooserPanel->FieldPanel
- Pillow==9.1.0, Willow==1.5
wagtail.coredeprecated
- Django@4.2 强制要求 MySQL@8