为什么这些" ///////"在渲染的jinja2模板中?

时间:2018-01-09 07:04:51

标签: flask jinja2

有问题的路线是直截了当的 -

@app.route('/user_access', methods=['GET', 'POST'])
@login_required
def user_access():
    userlist  = User.query.all()
    username = current_user.username
    return render_template("userlist.html", userlist=userlist, username=username)

模板也很简单......

    {% extends "base.html" %}
    {% block content %}
    <div class="container">
    <h2>Users with access to PCBevo </h2>

        <table class="table">
            <thead>
                <tr>
                    <th>UserID</th>
                    <th>Email</th>
                <tr>
            </thead>
            <tbody>
                {% for record in userlist %}
                <tr>
                    <td>{{record.username}}</td>
                    <td>{{record.email}}</td>/
                </tr>
                {% endfor %}
            </tbody>
        </table>
        <p><a href="/register_user">Add a new user to the access list</a></p>
    </div> <!-- /container -->
    {% endblock %}

但由于某种原因,我不明白,模板渲染了一堆斜线。有谁知道这是为什么? enter image description here

1 个答案:

答案 0 :(得分:1)

在您的一个表格单元格后面有一个向前的斜杠:

<td>{{record.email}}</td>/