Answer the question
In order to leave comments, you need to log in
How to display data from the database in Django Templates separated by commas?
Good afternoon. I can't find an answer to my question. I have a list of people that should be displayed on the site from the database. I made a conclusion. But there is one BUT. Everything is displayed in a row, without commas. I found an output option using |join:", " , but in this case a comma is placed after each letter. How to be? Thank you!
<li style="list-style: none"><span><b>Актеры:</b>
{% for actor in movie.actors.all %}
<a href="{% url 'actor_detail' actor.name %}">{{ actor.name }}</a>
{% endfor %}
</span></li>
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