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
- How does Django ORM parse SQL queries?
- Django Queryset Datetime Filter
- Can't load .css and image files in django
Source:stackexchange.com