I have this simple view which sends the comments in the context.
def room(request,pk):
room = Room.objects.get(id=pk)
messages = room.message_set.all()
description = room.description.split('\n')
context = {'room':room, 'description':description,messages:'messages'}
return render(request, 'base/room.html', context)
The corresponding HTML and DTL is as below
{% extends 'main.html' %}
{% block content %}
<h1>{{room.name}}</h1>
<p>{{room.description}}</p>
<div class="comment-wrapper">
<h3>Conversation</h3>
<hr>
{% for message in messages %}
<div>
<small>
@{{messages.user}} - {{messages.created}}
</small>
</div>
{% endfor %}
</div>
{% endblock %}
However I dont see the messages in the rendered HTML. What am I missing.