首页 > 解决方案 > TemplateSyntaxError: Encountered unknown tag 'endblock'

问题描述

layout.html :-

<!DOCTYPE html>
<html>
<head>
     <script src="https://d3js.org/d3.v4.min.js"></script>
     <link rel="stylesheet" type="text/css" href="{{ url_for('static', filename='css/styles.css') }}">
</head>
<body>

    <div id="header">
        <label id="headLabel"></label>
    </div>
    <div id="sidePanel">
    </div>
    <div id="content">
        {% block content %}
        {% endblock content %}
    </div>
    <div id="footer">
        <label id="footerLabel">Created By: Anish Saha</label>
    </div>
</body>
</html>

home.html :-

{% extends "layout.html" %}
(% block content %}
    <h1>Hello</h1>
{% endblock content %}

Error: TemplateSyntaxError: Encountered unknown tag 'endblock'.

Kindly help, I'm new to using flask

标签: flask

解决方案


你有错字

(% block content %}

更改({

{% block content %}

推荐阅读