GALERİ

We make You Stronger Than Your Excuses

Other than using get_children, the preceding blog_index_page.html template is similar to your previous work with the home_page.html template. You will learn about the use of get_children later in the tutorial.If you have a Django background, then you will notice that the pageurl tag is similar to Django’s url tag, but takes a Wagtail Page object as an additional argument.Now that this is complete, here is how you can create a page from the Wagtail admin interface:

  1. Go to http://127.0.0.1:8000/admin and sign in with your admin user details.
  2. In the Wagtail admin interface, go to Pages, then click Home.
  3. Add a child page to the Home page by clicking the + icon (Add child page) at the top of the screen.
  4. Choose Blog index page from the list of the page types.
  5. Use “Blog” as your page title, make sure it has the slug “blog” on the Promote tab, and publish it.

You can now access the URL, http://127.0.0.1:8000/blog on your site. Note how the slug from the Promote tab defines the page URL.Now create a model and template for your blog posts. Edit blog/models.py to include:

OUR TEAM

Meet Expert Trainers!