1
ログインが必要なフラスコ - sqlalchemy webappに取り組んでいます。 ログアウトボタンは、ユーザーがログインしている場合にのみ、ページ上で表示されるはずです したがって、すべてのこれらのページはこのようになりますlayout.htmlファイル拡張:。フラスコ:タグが指定されていても、未知のタグendifが見つかりました
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="description" content="">
<meta name="author" content="">
<title>Login</title>
<link href="{{ url_for('static', filename='css/bootstrap.min.css') }}" rel="stylesheet">
{% block head %} {% endblock %}
</head>
<body>
{% block body %}
<style type="text/css">
#footer {
position : absolute;
bottom : 0;
}
</style>
{ % if session['logged_in'] %}
<div id="footer" style="width:300px;height:100px"><a href=" {{url_for('logout')}}" style="width:100%;background:#f1f1f1;">Logout</a></div>
{% endif %}
{% endblock %}
<script src="{{ url_for('static', filename='js/jquery.js') }}"></script>
<script src="{{ url_for('static', filename='js/bootstrap.min.js') }}"></script>
</body>
</html>
を私が得ているエラーは、次のとおりです。
TemplateSyntaxError: Encountered unknown tag 'endif'. Jinja was looking for the following tags: 'endblock'.
閉じなければならない最も内側のブロックは「ブロック」です。末端ブロックが、
とタグが を指定されている場合は、私が解決助けてください、この