Created
February 10, 2015 19:59
-
-
Save jonsimington/445fc0116a3ef173f18c to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| {% for post in blog_posts %} | |
| {{ post.description }} | |
| {% endfor %} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from django.views.generic.base import TemplateView | |
| from blog.models import Post | |
| class BlogView(TemplateView) | |
| template_name = "template.html" | |
| def get_context_data(self, **kwargs): | |
| context = super(BlogView, self).get_context_data(**kwargs) | |
| context['blog_posts'] = Post.objects.all() | |
| return context |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment