Python 查找键[开始索引]失败

Python 查找键[开始索引]失败,python,django,django-templates,django-pagination,Python,Django,Django Templates,Django Pagination,我的分页有问题这是我的代码模板 {% for post in post %} <tr class="text-center"> <td> {{forloop.counter|add:post.start_index }} </td> {%endfor%} 我添加了一个分页,效果很好,但我想数一数行,这就是我看到的 请将变量名post更改为项。不应使用循环变量 {% for item in post %} <tr cla

我的分页有问题这是我的代码模板

{% for post in post %}
    <tr class="text-center">
  <td>
    {{forloop.counter|add:post.start_index }} 
 </td>
 {%endfor%}
我添加了一个分页,效果很好,但我想数一数行,这就是我看到的

请将变量名
post
更改为
。不应使用循环变量

{% for item in post %}
    <tr class="text-center">
  <td>
    {{forloop.counter|item.start_index }} 
 </td>
 {% endfor %}
{%用于post%中的项目]
{{forloop.counter | item.start_index}}
{%endfor%}

请将变量名
post
更改为
。不应使用循环变量

{% for item in post %}
    <tr class="text-center">
  <td>
    {{forloop.counter|item.start_index }} 
 </td>
 {% endfor %}
{%用于post%中的项目]
{{forloop.counter | item.start_index}}
{%endfor%}

hi请将for循环更改为:{post%}{{forloop.counter | add:po.start_index}{%endfor%}for循环变量的名称不应与基变量相同。hi请将for循环更改为:{post%}{forloop.counter | add:po.start_index}{%endfor%}{%endfor%}for循环变量的名称不应与基变量相同。