{% extends "prosvet_logs/base.html" %}
{% block content %}
<div class="article">
<h2>{{ el }}</h2>
{% if new %}
{% for el in new %}
<p>{{ new.date_added|date:'M d, Y H:i' }}</p>
<p>{{ new.body|linebreaks }}</p>
{% endfor %}
{% else %}
<p>Новостей нет</p>
{% endif %}
</div>
{% endblock content}
def el(request, el_id): #Вывод отдельной новости
article = News.objects.get(id=el_id)
entries = article.news_set.order_by('-date_added')
context = {'el':el, 'news': news}
return render(request, 'prosvet_logs/article.html', context)