2

我是 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教程。

任何帮助将不胜感激。

4

1 回答 1

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 %}
于 2014-08-23T07:34:10.590 回答