this is my flask code:
< H1 > coding=utf-8 < / H1 > from flask import render_template, request,flash, redirect, url_for,current_app,abort
from. Import main
from.. import db
from.. models import Post, Comment
from flask_login import login_required, current_user
from .forms import CommentForm, PostForm
from flask_babel import gettext as _
@ main.errorhandler
def page_not_found (error):
return render_template("404.html"), 404
@ main.route ("/")
def index ():
page_index = request.args.get("page", 1, type=int)
query = Post.query.order_by(Post.created.desc())
pagination = query.paginate(page_index, per_page=20,error_out=False)
posts = pagination.items
return render_template("index.html",
title=_(u"Lee"),
posts=posts,
pagination=pagination)
this is my template code:
{% extends" bootstrap/base.html"%}
{% block title%} {{title}} {% endblock%}
{% block head%}
{{ super() }}
{% include ["includes/_head.html", "includes/_metas.html"] %}
{% endblock%}
{% block styles%}
{{ super() }}
<link rel="stylesheet"
href="https://maxcdn.bootstrapcdn.com/bootswatch/3.3.5/cerulean/bootstrap.min.css ">
{% endblock%}
{% block navbar%}
{-sharp { nav.top.render() }} -sharp}
{% include "includes/_navbar.html" %}
{endblock}
{block content}
{% block header %}
<header>
<div class="page-header">
<div class="container">
<h1>{{ title }}</h1>
</div>
</div>
</header>
{% endblock %}
{% block page_body %}
{% endblock %}
{endblock}
this is my error display:
is it the wrong way I use it? Please answer