{% extends "base.html" %}

{% block content %}

{% for message in object.message_set.all|dictsortreversed:"created_on" %}
    <p>{{ message.text }} - {{ message.created_on }}</p>
    <br />
{% endfor %}

<form action="{% url 'inbox:new-message' object.id %}" method="post">
    {% csrf_token %}
    {{ form.as_p }}
    <input type="submit" value="Submit" />
</form>
{% endblock %}

{% extends "base.html" %}

{% block content %}

{% for message in object.messages.all|dictsortreversed:"created_on" %}
    <p>{{ message.text }} - {{ message.created_on }}</p>
    <br />
{% endfor %}

<form action="{% url 'inbox:new-message' object.id %}" method="post">
    {% csrf_token %}
    {{ form.as_p }}
    <input type="submit" value="Submit" />
</form>
{% endblock %}

Fix typo: rename `message_set` to `messages`
Fix typo: rename `message_set` to `messages`
