【发布时间】:2011-12-19 21:10:54
【问题描述】:
这是填充我的页面的错误消息,附带代码问题:
/home 处的模板语法错误
无效的块标签:'endblock',应为'endif'
请求方法:GET
请求网址:http://localhost:8000/home
Django 版本:1.3.1
异常类型:TemplateSyntaxError
异常值:无效块标签:'endblock',预期为'endif'
代码:
{% extends "profile/base_with_classes.html" %}
{% block username %}
{% if user == None %}
Nobody
{% else %}
{% if user.is_authenticated %}
{{ user.username }}
{% else %}
Unauthenticated User
{% endif %}
(% endif %}
{% endblock username %} <==== Issue is here
我不明白。这是模板的顶部。
【问题讨论】: