小编use*_*857的帖子

二维数组Django

我的django应用程序中有一个二维数组,我需要传递给html模板.

我如何使HTML处理二维数组?

 {% block content %}

  <h2>Survey</h2>
      <form>

    {% for q in question %}   
          <p>{{q[0]}}</p>
          <p>{{q[1]}}</p>
    {% endfor %}
     <input type="submit" value="submit">
     </form>

{% endblock %}
Run Code Online (Sandbox Code Playgroud)

我收到了错误:

    Could not parse the remainder: '[0]' from 'q[0]'
Run Code Online (Sandbox Code Playgroud)

html python django django-templates

2
推荐指数
1
解决办法
3640
查看次数

标签 统计

django ×1

django-templates ×1

html ×1

python ×1