1
0
Fork 0
IdreXyz/news/views.py

13 lines
362 B
Python
Raw Normal View History

2016-02-02 18:28:58 +01:00
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)