Reputation: 349
I am getting the following error message in my django template: Unclosed tag on line 10: 'if'. Looking for one of: endif.
I use endif on line 20 to close the if category. if pages is closed on line 16. Not sure if it is a syntax issue?
<!DOCTYPE html>
<html>
<head>
<title>Rango</title>
</head>
<body>
<div>
{% if category %}
{{ category.name }}
<ul>
{% if pages %}
{% for page in pages %}
<li> {{ page.title }} </li>
{% endfor %}
</ul>
{% else %}
<strong>No Pages</strong>
{% endif %}
{% else %}
<strong>The specified category does not exist!</strong>
<% endif %}
</div>
</body>
Upvotes: 3
Views: 5239
Reputation: 148
In the last endif, you have ( instead of {
<% endif %}
to
{% endif %}
Upvotes: 2