from django.shortcuts import render import markdown from news.models import Article def articles_view(request): articles = Article.objects.all().order_by("date").reverse() for article in articles: article.content = markdown.markdown(article.content) context = { "articles": articles } return render(request, "news/news.html", context)