Skip to content

Commit 6cddf25

Browse files
committed
fix: create home page as child of root in Wagtail initial data setup
_setup_wagtail_initial_data was only creating the root page (depth=1). The page explorer shows children of root, so without a home page (depth=2) the explorer shows 0 pages. Also update the default site to point to the home page rather than the treebeard root.
1 parent afc43ec commit 6cddf25

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

src/dbx_python_cli/commands/project.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -839,9 +839,10 @@ def _setup_wagtail_initial_data(
839839
" locale, _ = Locale.objects.get_or_create(language_code=lang)",
840840
" ct, _ = ContentType.objects.get_or_create(app_label='wagtailcore', model='page')",
841841
" root = Page.add_root(title='Root', slug='root', content_type=ct, locale=locale)",
842+
" home = root.add_child(title='Home', slug='home', content_type=ct, locale=locale)",
842843
" print('wagtail_root_created')",
843844
" if not Site.objects.exists():",
844-
" Site.objects.create(hostname='localhost', root_page=root, is_default_site=True)",
845+
" Site.objects.create(hostname='localhost', root_page=home, is_default_site=True)",
845846
" print('wagtail_site_created')",
846847
"except ImportError:",
847848
" pass",

0 commit comments

Comments
 (0)