0
0
mirror of https://github.com/wagtail/wagtail.git synced 2024-12-01 11:41:20 +01:00

Add basic blog template to tutorial.

Seems like an oversight since they soon tell you to "adjust" it.
This commit is contained in:
ryneeverett 2015-06-21 18:39:47 -04:00
parent 0ed4e26d63
commit bfe6fb45cc

View File

@ -136,6 +136,25 @@ The following example defines a basic blog post model in ``blog/models.py``
FieldPanel('body', classname="full") FieldPanel('body', classname="full")
] ]
Create a template at ``blog/templates/blog/blog_page.html``:
.. code:: html+django
{% extends "base.html" %}
{% load static core_tags wagtailcore_tags %}
{% block body_class %}templage-blogpage{% endblock %}
{% block content %}
<h1>{{ self.title }}</h1>
<p class="meta">{{ self.date }}</p>
<div class="intro">{{ self.intro }}</div>
{{ self.body | richtext }}
{% endblock %}
Run ``python manage.py makemigrations`` and ``python manage.py migrate``. Run ``python manage.py makemigrations`` and ``python manage.py migrate``.
.. figure:: ../_static/images/tutorial/tutorial_4.png .. figure:: ../_static/images/tutorial/tutorial_4.png
@ -185,7 +204,7 @@ model:
FieldPanel('body'), FieldPanel('body'),
] ]
Adjust your BlogPage template to output the image: Adjust your blog page template to include the image:
.. code:: html+django .. code:: html+django
@ -206,7 +225,6 @@ Adjust your BlogPage template to output the image:
<div class="intro">{{ self.intro }}</div> <div class="intro">{{ self.intro }}</div>
{{ self.body | richtext }} {{ self.body | richtext }}
{% endblock %} {% endblock %}
.. figure:: ../_static/images/tutorial/tutorial_6.png .. figure:: ../_static/images/tutorial/tutorial_6.png