Django-异常值:if标记中的表达式意外结束
我想不出可能是什么错误。 我已经检查了文档,看看是否有任何语法变化,但我没有发现任何变化Django-异常值:if标记中的表达式意外结束,django,django-views,django-templates,Django,Django Views,Django Templates,我想不出可能是什么错误。 我已经检查了文档,看看是否有任何语法变化,但我没有发现任何变化 Unexpected end of expression in if tag. Template error: In template /home/dhruv/django-blog/blog/templates/blog/post_detail.html, error at line 5 Unexpected end of expression in if tag. 1 : {% exten
Unexpected end of expression in if tag.
Template error:
In template /home/dhruv/django-blog/blog/templates/blog/post_detail.html, error at line 5
Unexpected end of expression in if tag.
1 : {% extends 'blog/base.html' %}
2 :
3 : {% block content %}
4 : <div class="post">
5 : {% if post.published_date %}
6 : <div class="date">
7 : {{ post.published_date }}
8 : </div>
9 : {% elif %}
10 : <a class="btn btn-default" href="{% url 'post_publish' pk=post.pk %}">
11 : Publish!
12 : </a>
13 : {% endif %}
14 :
15 : {% if user.is_authenticated %}
替换:
{% elif %}
与
************博士
if/else可通过以下方式使用:
{% if condition %}
{% endif %}
或
或
或
替换:
{% elif %}
与
************博士
if/else可通过以下方式使用:
{% if condition %}
{% endif %}
或
或
或
{% if condition1 %}
{% elif condition2 %}
{% else %}
{% endif %}
{% if condition %}
{% else %}
{% endif %}