作者热门文章
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
当我执行HTML代码时,会出现以下错误:
Could not parse the remainder: '{{' from '{{'
{% block content %}
<p align="justify"> So far you donated {{ donated_trees }} Tree(s). </p>
{% if treatmentgroup == 'two' or treatmentgroup == 'three' %}
Your current position is {{ player.end_position }} of {{ anzahlspieler }} for the most donated trees.
{% endif %}
{% if treatmentgroup == 'two' or treatmentgroup == 'three' and {{ player.rival }} == 0 %}
<P> No other player has the same.</P>
{% endif %}
{% if treatmentgroup == 'two' or treatmentgroup == 'three' and {{ player.rival }} == 1 %}
<P> One other player has the same.</P>
{% endif %}
{% if treatmentgroup == 'two' or treatmentgroup == 'three' and {{ player.rival }} > 1 %}
<P> {{ player.rival }} other players have the same.</P>
{% endif %}
最佳答案
您不能在模板标记内使用{{ … }}
,而只能使用变量本身:
{% block content %}
<p align="justify"> So far you donated {{ donated_trees }} Tree(s). </p>
{% if treatmentgroup == 'two' or treatmentgroup == 'three' %}
Your current position is {{ player.end_position }} of {{ anzahlspieler }} for the most donated trees.
{% endif %}
{% if treatmentgroup == 'two' or treatmentgroup == 'three' and player.rival == 0 %}
<P> No other player has the same.</P>
{% endif %}
{% if treatmentgroup == 'two' or treatmentgroup == 'three' and player.rival == 1 %}
<P> One other player has the same.</P>
{% endif %}
{% if treatmentgroup == 'two' or treatmentgroup == 'three' and player.rival > 1 %}
<P> {{ player.rival }} other players have the same.</P>
{% endif %}
关于html - Django : Could not parse the remainder: '{{' from '{{,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58189242/
我是一名优秀的程序员,十分优秀!