'BlockNode'对象没有属性'context'

时间:2013-10-02 17:58:52

标签: python django django-endless-pagination

我是django / python的新手。我正在使用django-endless-pagination在滚动上尝试分页,并发现以下错误:'BlockNode' object has no attribute 'context'

entry_index.html

<h2>Logs:</h2>
{% include page_template %}
{% block js %}
{{ block.super }}
<script src="http://code.jquery.com/jquery-latest.js"></script>
<script src="{{ STATIC_URL }}endless_pagination/js/endless-pagination.js"></script>
<script>
    $.endlessPaginate({
        paginateOnScroll: true,
        paginateOnScrollChunkSize: 5
    });
</script>
{% endblock %}

entry_index_page.html

{% for i in list %}
    {{ i }}
{% endfor %}

我正在关注Django Endless Pagination教程。

非常感谢任何帮助。

1 个答案:

答案 0 :(得分:4)

{% include page_template %}
    {% block js %}
        <script src="http://code.jquery.com/jquery-latest.js"></script>
        <script src="{{ STATIC_URL }}endless_pagination/js/endless-pagination.js"></script>
        <script>$.endlessPaginate();</script>
    {% endblock %}

我在模板中使用了这样的代码而不是下面显示的代码..然后它工作了......

{% include page_template %}
{% block js %}
    {{ block.super }}
    <script src="http://code.jquery.com/jquery-latest.js"></script>
    <script src="{{ STATIC_URL }}endless_pagination/js/endless-pagination.js"></script>
    <script>$.endlessPaginate();</script>
{% endblock %}