Why I have a loading error for endfor on my html file on django?

3959 views python
5

I am trying to make a loop inside a template on django and the html file is telling me that I have to load the {% endfor %} ? What do I do ?

<div style= "margin-left: 2em">
            <form action= "{% url 'filled' %}" method = "POST" role = "form">
                <div class="form-group">
                    <div class="input-group">
                        <table>
                            <tr>
                            {% for given_value in given_values % }
                                <th>{{given_value.given_value}}</th>
                            {% endfor %}

answered question

Is the space between "%" and "}" in the line "{% for given_value in given_values % }" by purpose?

1 Answer

11

Typo. {% for given_value in given_values % } should be {% for given_value in given_values %} There needs to be no space between % and }

posted this

Have an answer?

JD

Please login first before posting an answer.