A
A
artchis2021-01-10 18:23:23
Django
artchis, 2021-01-10 18:23:23

Why doesn't html insert work in the for block?

I don't understand why the HTML code doesn't work in {% for el in news %}?

The code itself:

{% for el in news %}
  <p>{{ el.title }}</p>
{% endfor %}


Or this:
{% for el in news %}

      <div class="card-body">
        <p class="card-text">{{ el.anons }}</p>
        <div class="d-flex justify-content-between align-items-center">
          <div class="btn-group">
            <button type="button" class="btn btn-sm btn-outline-secondary">Дополнительно</button>
            <button type="button" class="btn btn-sm btn-outline-secondary">Скачать</button>
          </div>
          <small class="text-muted">{{ el.date }}</small>
        </div>
      </div>
    </div>
  </div>
{% endfor %}

Inside this code, no information is displayed on the site at all.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Dr. Bacon, 2021-01-10
@bacon

e.g. news is empty

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question