【问题标题】:Could not parse the remainder: '\u2018polls:detail\u2019' from '\u2018polls:detail\u2019无法解析剩余部分:来自“\u2018polls:detail\u2019”的“\u2018polls:detail\u2019”
【发布时间】:2018-04-17 23:07:28
【问题描述】:
{% if latest_question_list %}
    <ul>
    {% for question in latest_question_list %}
    <li><a href=“{% url ‘polls:detail’ question.id %}”>{{ question.question_text }}</a></li>
    {% end for %}
    </ul>
{% else %}
    <p>No polls are available.</p>
{% endif %}

无法弄清楚出了什么问题。感觉可能是空间。需要帮助,请。

【问题讨论】:

    标签: django-templates


    【解决方案1】:

    请检查此类似查询 [How to resolve TemplateSyntaxError: Could not parse the remainder error?

    'polls:detail' 应该用单引号或双引号括起来(这样做的能力取决于本地 m/c 上安装的字体)。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2021-12-20
      • 2015-12-31
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2020-07-09
      • 2020-10-10
      • 2021-04-15
      相关资源
      最近更新 更多