1👍
✅
You’re page is loaded from a different view called direct_to_template
that has nothing to do with the latest_posts
view so it will never find its context data.
So now 1 of two things needs to happen, either you just consume the code from latest_posts
re: the context data into that other view and include it in that context. Or you make a url to point to that page
from views import latest_posts
url("^latest_posts$", latest_posts, name="latest_posts"),
Now this will get you the posts showing from the url /latest_posts
, but it probably doesn’t look very pretty, it could be an option to have the latest_posts
view still load the base.html template which will make it look more like you expect, although a browse through the documentation on template inheritance may help more
Source:stackexchange.com