| 123456789101112131415 |
- import markdown
- from django.shortcuts import render
- from common.models import Article
- # Create your views here.
- def article(request,id):
- art = Article.objects.filter(id=id).first()
- if art is None:
- return render(request, '404.html')
- context = {
- 'title':art.title,
- 'content':markdown.markdown(art.markdown_content),
- }
- return render(request, 'article.html',context)
|