문제

I'm new to Django, and am using Mezzanine in order to create a basic blog website. One thing I wanted to achieve was using the supplied blog_post_list template as a base for the homepage. In the Mezzanine docs, it explains how to do this, however, I want to make changes to this template. As such, I followed the instructions of creating a local copy of the mezzanine blog home page template and editing the urlpatterns in urls.py to point to the local copy of the file. However, when I try to render this home page in my browser, the following error occurs:

Error during template rendering at Line 145 in (local copy of) blog_post_list.html: {% pagination_for blog_posts %}

For reference, here is the html file in question: https://github.com/stephenmcd/mezzanine/blob/master/mezzanine/blog/templates/blog/blog_post_list.html

The pages have been copied and unedited from Mezzanines core, so why does it work when being opened in Mezzanine's core, but not when in my local project directory?

도움이 되었습니까?

해결책

In urls.py,

url("^$", direct_to_template, {"template": "blog/blog_post_list.html"}, name="home"),

should be

url("^$", blog_post_list, name="home"),

also,

from mezzanine.blog.views import blog_post_list
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top