[Fixed]-Cannot Render Entries to Page

1πŸ‘

βœ…

The | syntax is for template filters. To get the model values in the template there is a dot notation:

{{ entry.title }}
{{ entry.content }}

Note that the reason why {{ entry|title }} did not throw any errors is that there is a built-in title template filter. But there is no content template filter – this is why you see the error on the line containing {{ entry|content }}.

πŸ‘€alecxe

0πŸ‘

Since I solved my own problem, I’m writing here for the sake of other users having same problem.

Since I returned a render in views.py as below:

render(request, "home.elms.html", context)

The template should call for dictionary inside the context as:

{% for entry in entries %}

not:

{% for entry in context.entries %}
πŸ‘€Eray Erdin

Leave a comment