D
D
DenNewGit2018-03-24 16:14:14
Django
DenNewGit, 2018-03-24 16:14:14

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)

In the template I write:
{% for ms in msg %}

  <h2>{{ ms.post }}</h2>
  <br>
  {% endfor %}

But it happens that the message is too large and it needs to be transferred to different lines, and not displayed in one, as here. How to do it?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
sim3x, 2018-03-24
@DenNewGit

Learn css
Required to set block width

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question