Answer the question
In order to leave comments, you need to log in
How to display data nicely in Django?
There is a function that passes all messages in the chat to the template:
def allmessage_global(request):
msg = GlMsg.objects.all().order_by('-created')
args = {
'msg': msg
}
return render(request, 'home/home_msg_global.html', args)
{% for ms in msg %}
<h2>{{ ms.post }}</h2>
<br>
{% endfor %}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question