Skip to content

Instantly share code, notes, and snippets.

@jonsimington
Created February 10, 2015 19:59
Show Gist options
  • Save jonsimington/445fc0116a3ef173f18c to your computer and use it in GitHub Desktop.
Save jonsimington/445fc0116a3ef173f18c to your computer and use it in GitHub Desktop.
{% for post in blog_posts %}
{{ post.description }}
{% endfor %}
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