예제 #1
0
파일: views.py 프로젝트: pixyj/pramod.io
def projects(request):
    """
    1. Convert the markdown strings on the top of the page to html
    2. Render the response
    """
    heading_html = Post.md_to_html(HEADING)
    projects = Project.objects.filter(is_published=True).order_by('-created').prefetch_related('tags')
    for p in projects:
        p.tag_names = [tag.name for tag in p.tags.all()]
    return render(request, 'projects.html', {
        "heading": heading_html,
        "projects": projects
    })
예제 #2
0
파일: models.py 프로젝트: pixyj/pramod.io
 def html_description(self):
     return Post.md_to_html(self.description)
예제 #3
0
파일: views.py 프로젝트: pixyj/pramod.io
def about(request):
    about_html = Post.md_to_html(ABOUT_ME)
    print(about_html)
    return render(request, "about.html", {"about": about_html})