2013-10-02 35 views
2

我是django/python的新手。我使用的Django無端分頁滾動嘗試分頁,發現下面的錯誤:'BlockNode' object has no attribute 'context''BlockNode'對象沒有屬性'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教程這一點。

任何幫助將不勝感激。

+0

可以顯示完整的HTML? – karthikr

+0

@karthikr - 用整個html更新了上面的問題。 –

+5

你是不是從任何地方'擴展'這個模板?如果不是,則刪除'{{block.super}}' – karthikr

回答

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 %}