Wagtail Unboxed episode 02 7:51
Opening the box: every file explained
The wagtail start command generates 29 files. Most tutorials explain three of them. We read all of them, because the ones you are told to ignore decide how your site behaves.
What this episode covers
The highlight is the data migration that quietly created your homepage. Nobody opens 0002_create_homepage.py, and it explains the page tree, content types and Wagtail's multi-site model all at once, including why your homepage's database row has a path of 00010001.
Also covered: Wagtail is about eleven Django apps in INSTALLED_APPS, and that is the whole mental model; why the wagtail_urls catch-all must be the last URL pattern; PROJECT_DIR against BASE_DIR, and STATIC_ROOT against STATICFILES_DIRS against MEDIA_ROOT; the settings split into dev.py, production.py and the local.py escape hatch; two settings that ship as broken placeholders; and a real inconsistency, where the generated requirements.txt caps Django below 6.1 but pip installs 6.1.1.
No code is written this episode. Read the box before you rebuild it.
Chapters
- 0:00 29 files, and why we're reading all of them
- 0:20 No code today
- 0:32 manage.py and the settings split
- 0:51 PROJECT_DIR vs BASE_DIR
- 1:07 INSTALLED_APPS
- 1:13 Wagtail is just Django apps
- 1:31 The one middleware addition
- 1:46 Static vs media
- 2:09 The Wagtail settings block
- 2:36 dev.py, production.py, and local.py
- 3:01 urls.py
- 3:06 Why the catch-all must be last
- 3:30 HomePage(Page) — six lines
- 3:51 How templates find themselves
- 4:10 The migration nobody opens
- 4:30 Inside the migration
- 4:48 Treebeard: what “00010001” means
- 5:22 Two pages, not one
- 5:38 The Site row
- 5:54 The search app
- 6:13 base.html and the Wagtail userbar
- 6:30 The requirements.txt discrepancy
- 7:02 Five things to remember
- 7:31 Next episode
Versions on screen
Wagtail 7.4.3 · Django 6.1.1 · Python 3.12. Recorded on Windows; macOS and Linux commands are in the repository for every episode.