Skip to content

Instantly share code, notes, and snippets.

@dead23angel
Created February 20, 2014 12:54
Show Gist options
  • Save dead23angel/9112875 to your computer and use it in GitHub Desktop.
Save dead23angel/9112875 to your computer and use it in GitHub Desktop.
from django.shortcuts import render_to_response
from django.template import RequestContext
from blog.views import Post
def home(request):
vars = dict (
posts=Post.objects.all().order_by('-timestamp')[:10],
)
return render_to_response('index.html', vars, context_instance=RequestContext(request))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment