I would like to create programatically a sub page for a known parent.
here is the code.
parent_page = Page.objects.get(title='index02').specific
news_page = BlogPage(
title = 'title test 08',
slug = 'title_test_08',
body='Something pleasant to hear.',
intro="desc",
)
parent_page.add_child(instance=news_page)
news_page.save()
It works, but I added tags = '[tag01,tag02]' in news_page , It failed to add tags, Could sb tell me how to add tags? thanks.
you need to add tags as a list: